title: PAM's passwd retry prompt fail

text: I am trying to use PAM to stop password reuse. Adding 'remember=24' to pam_unix stores the old passwords hashed with MD5 which I find unnerving. I was recommended 'pam_pwhistory' instead. Here is the password section of my /etc/pam.d/system-auth file that /etc/pam.d/passwd includes               password    requisite     pam_cracklib.so retry=3 try_first_pass     password    requisite     pam_pwhistory.so remember=24 retry=3 use_authtok     password    sufficient    pam_unix.so sha512 rounds=5000 shadow use_authtok     password    required      pam_deny.so      When I try to change my password, if I fail the password reuse test, I don't get to retry. Instead a "Password:" prompt appears               $ passwd     (current) Unix password: <current password>     New password: <old password>     Retype new password: <old_password>     Password has already been used. Choose another.     Password: <current password>     passwd: Authentication token manipulation error      I have a similar same issue if I fail the pam_cracklib test more than the retry #. Except that my current password works with the prompt               $ passwd     (current) Unix password: <correct password>     New password: <too simple password>     BAD PASSWORD: it too simple     New password: <too simple password>     BAD PASSWORD: it too simple     New password: <too simple password>     BAD PASSWORD: it too simple     Password: <current password>     passwd: Have exhausted maximum number of retries for service      If I set retry=1 for pam_pwhistory, then the current password works for the prompt.               $ passwd     (current) Unix password: <current password>     New password: <old password>     Retype new password: <old_password>     Password has already been used. Choose another.     Password: <current password>     passwd: Have exhausted maximum number of retries for service      The inablility to retry if you use an old password and this strange 'Password: ' are the only problem. Old passwords are stored in /etc/security/opasswd using their original hash function. It looks like   1. pam_pwhistory can't retry because it's in the middle of the stack?   2. A failure in pam_pwhistory doesn't cause pam_unix to fail, it instead prompts user? I am on a CentOS 6.3


title: Wine fails with DirectX on Pinguy

text: I am trying to use Wine to play a 3d game on Linux that will run as long as the base system has the correct Direct X rendering. I have tried the Wine configurations and come up with: http:/(s19.postimage.org/lgv1ky8dv/Selection_002.jpg)               $# wine ~/.wine/drive_c/windows/system32/dxdiag.exe     X Error of failed request:  BadRequest (invalid request code or no such operation)     Major opcode of failed request:  136 (GLX)     Minor opcode of failed request:  19 (X_GLXQueryServerString)     Serial number of failed request:  145     Current serial number in output stream:  145      The error may be related to the Wine configuration but I followed the guide (with ver jun2010) to the T on this and I just cant seem to get this to work on my Pinguy (Ubuntu 12.04 kernel: 3.2.0-25-generic-pae) system. Can anyone assist me with these drivers? I believe it is a bug within the X.org. I do not have an `/etc/x11/xorg.conf` and my system graphics settings does not show (as other bug reports have said also). I still don't understand how I can fix this. I have tried AMD installs (in case my processor has a hybrid). I have tried to see if I could compile a new driver (unsuccessful). EDIT: i believe it is the stock drivers (MESA Intel sandybridge) but it should be (Intel HD 3000) also i have found that there is a bug reported for xorg or mesa (both are listed as causes) where it does not show up on the system tools and does not play well, both are my symptoms, yet installing mesa-tools does not solve it My complete computer specs


title: nVidia drivers in Xorg / KDE - performance and stability for different cards

text: I have a GeForce 250 GTS card and I am using the proprietary drivers in Linux (KDE on Debian Testing). Unfortunately recently I had a lot of issues with stability and performance - I had quite a few system crashes and the performance is appalling. There are various workarounds, but they don't always work and some of them help with one application, but make another one worse... I was planning to upgrade my GPU anyway, hence the question - is the situation better on newer GPUs? Or should I move to a Radeon instead? I might have an opportunity to join a CUDA project in a couple of months, but it doesn't really matter if I can't use my desktop... I need a reasonable graphics card for some gaming in Windows, but in Linux I am just using basic KDE and Gnome applications, Iceweasel (Firefox), Chrome, GIMP, etc. so nothing fancy really.


title: How to get the complete and exact list of mounted filesystems in Linux?

text: I usually use `mount` to check which filesystems are mounted. I also know there is some connection between `mount` and `/etc/mtab` but I'm not sure about the details. After reading How to check if /proc/ is mounted I get more confused. My question is: How to get the most precise list of mounted filesystems? Should I just use `mount`, or read the contents of `/etc/mtab`, or contents of `/proc/mounts`? What would give the most trustworthy result?


title: Is there a distribution that offers frequent updates to software packages, but stability and consistency in system packages?

text: I used to use Arch, but it became painful to update if I'm only updating the system every few (3-6 months, typically closer to 6 months). I began to look at other distributions, but it seems like my only options are rolling release distributions and ones on a release cycle where all packages are tied to that cycle. Is there a distribution that is a happy medium, where the core OS updates come out every few months and are guaranteed to be stable, but their package repositories are updated more frequently so my installs of Chromium, Eclipse, the JDK, GCC, and other tools are up to date quickly after the software is updated?


title: Fast switching between external and internal screen

text: Is there a solid way of using either X directly or KDM/GDM/KDE/Gnome to quickly switch between an external screen and modify the screen layout accordingly? I'm stealing the inspiration from Windows 7's +P functionality, where a central popup shows 4 different possible layouts: only external, duplicate, only internal screen, extend desktop. I can switch between any (or at least most) of these by using the Nvidia control panel (and if I was using the open source drivers, through the KDE X screen configuration option screen, and something similar for Gnome). I would like a faster way to just switch output, without having to go through billions of menus (ok, slightly exaggerated, but still... you get the point)


title: +x permission for files in directory

text: I'm an Ubuntu user and I'd like to change default permissions for downloaded files. Currentely all downloaded files are automatically saved with "-rw-r-- r--" permissions (umask 0022). I'd like to add "+x". How to do that? Regards


title: Parabola installation, "network is unreachable" despite working ping

text: I am trying to install Parabola(closely related to Arch Linux). As my wireless adapter does not work with linux due to some firmware issues, I have to use a wired connection. So, while a ping to www.google.com or 8.8.8.8 works out fine, everytime I try to install the base system               packman -Sy parabola-keyring      which is used to update the keyring package during installation, before you install the base system, says `network is unreachable`. I tried setting up a static ip, which did not work out and in the worst case made the ping not working anymore (which I fixed by rebooting the cd) and dhcpcd, which failed to. I tried solutions I read in 3 different threads, and nothing worked (e.g. changing the interface from eth0 to my own or editing `resolv.conf`). I am wondering why ping works but the network connection does not, so, any ideas? Output of ifconfig and iproute: niinii.de/?f=niinii139939920123.jpg and niinii.de/?f=niinii139939922850.jpg


title: How to capture from instensive pro in Ubuntu, Fedora, CentOS using HDMI interface?

text: I am trying to use PCI-X1 capture card (intensiy pro) using Ubuntu 10.04 (now) / 11.04 (failed) or Fedora (failed). None of them is yet capturing. I did my best but now i need some backup on this. Question: Do you know what is causing my capture/input as "Frame received (#0) - No input signal detected"? Where i have another **Playstation 3** connected in the input interface. Please find details, that i followed: **Step 1** : Drivers [OK]               $ uname -a     Linux sun-desktop 2.6.32-33-generic #70-Ubuntu SMP Thu Jul 7 21:13:52 UTC 2011 x86_64 GNU/Linux          $ lspci | grep magic     03:00.0 Multimedia video controller: magic Design Device a117          $ lsmod | grep magic     magic            441567  1      $ magicFirmwareUpdater status         magic0 [Intensity Pro]  0x1e    OK     $ ll /dev/magic/card0      crw-rw-rw- 1 root video 10, 55 2011-09-24 10:48 /dev/magic/card0      **Step 2** : Output test [OK] ![enter image description here](http://i.stack.imgur.com/R5dGD.png) **Step 3** : Input test [FAILED]               A) Failed (while trying to capture)              $ ./Capture -m2 -n 1         Frame received (#0) - No input signal detected         Stopping Capture


title: Gnome stop grabbing my emacs keys

text: I am using Gnome in Ubuntu 11.04. I work a lot in Emacs, and I find that the Gnome window manager grabs some of the Emacs keys. To some extent, I can stop this by laboriously going through each of System->Preferences->Keyboard shortcuts and disabling the offending keys. However it would be nice to do this once for everything. In addition, my latest problem is with org-mode, M-S-up should be org-shiftmetaup (org-move-subtree-up) but the window manager is grabbing that key combination and making shrunken windows. However, I cannot find that in the Keyboard Shortcuts list; I don't use it and have no idea what they call it (and it doesn't seem you can look up/edit the short cuts by key combination, only by name). So my questions are:   1. Is there one Gnome configuration change I can make that will by default disable all keyboard short cuts?   2. Is there then a way to re-enable some of them? (I don't use them much, but might want a couple that don't conflict with Emacs.)   3. Failing that, is there a way to disable shortcuts that conflict with Emacs, for instance by moving Meta to the Super key for Gnome only and not emacs?   4. Short of 3, is there a way to find a shortcut by the key combination so it can be disabled individually?


title: How do I set a script that it will run on start up in FreeBSD?

text: I am using FreeBSD 9 and I want to make a script that will check if an Ethernet cable is connected, and if so, connects to it. I want to set it so that it runs whenever the machine starts up, or whenever I log in. I looked at my UNIX book (It is pretty outdated, and is for general UNIX, not specifically FreeBSD) and it says that I can use crontab, but I can only do this to make things run at certain times, not when it starts up. Can someone please tell me how I can get at this?


title: Wrapping socket connections

text: I'd like to wrap an insecure connection (this one: http://culturedcode.com/things/) with a secure tunnel, a bit like http://en.wikipedia.org/wiki/Stunnel does, just using UNIX tools. What's the best way to intercept insecure traffic, encrypt it and deliver it to the insecure socket at the other end of the communication channel? I am used to wrapping/tunnelling VNC connections using SSH port forwarding, how would you do something to the same effect with an application such as Things for Mac/iPhone? Namely: a generic application using known ports to exchange unencrypted data? Bonus points for step-by-step instructions ;) Thanks!


title: Mounted a USB to /home and lost all the sub-directory's

text: I have been searching for a about a hour but I can't find a answer if someone knows another thread that will help I would gladly look through it. So what happened is I am learning about how to mount and un-mount. I have done what I am guessing is a very nob mistake by mounting a USB to my /home and lost all the sub dir under /home. This is a new install of Linux but old enough i don't want to reinstall (if i don't have to). I plugged in and removed the use be a few time to know what was the USB drive. Then I mounted it to the home. I found that all my sub-dir were gone. From what I have read it seems that all you needed to do is umount the USB and everything would be as it was before. Well. . . . didn't really work out that way. I even tried to recreate the dir but I is telling me it has a Input/Output error. I am thinking that this is because the OS still thinks that the drive is mounted to that dir.


title: How does Linux keep track of filesystems?

text: As I know, Linux has an abstract layer of all filesystems and this layer is VFS. If I create a new filesystem, I should follow rules made by VFS (see "Anatomy of the Linux virtual file system switch" for more information). After I made this new filesystem, I am going to mount it to the directory hierarchy. But I have a problem here: how the linux OS know my filesystem? Actually, there can be many filesystems in Linux. Some of them are mounted and can be found with command `mount`, others are not mounted but you can mount them anytime you like. Are these unmounted ones recorded in some place in the OS? I know there are two files `/etc/fstab` and `/etc/filesystems` may be concerned with my question but I am not sure.


title: How to install g++ 4.7.2 & c++11 on CentOS 5.x?

text: I'm trying to install the latest stable `g++` and `c++11`. My host did it through `yum install` and thought that it was the latest, but it's not, and they are now saying that this is beyond their level of support. I've looked all over on how to do this, and I can't make anything work, or I have no idea what the suggested solution is saying. What's the easiest way to install `g++` 4.7.2 and `c++11` on CentOS **5.9**?


title: What would be a light weight, memory non-intensive distro for virtual server use?

text: I have come across several posts talking about light weight distros from a general context, but none of them are really hitting the nail on the head for me. Specifically, I have PHP script that I run in the background constantly on a virtual server. My PHP script only uses about 60MB of memory. I potentially need to spin up 50 or so servers to run different variations of the script, although they will have the same memory use. Currently I am using Virtualbox on a Mac and Ubuntu Server, but stripped down to nothing, for some reason I cannot get it to use less than an average of 1GB of RAM (Ubuntu, via `top`, not VB). I really would like to get the entire install and top usage under 128M? 256M? What would be a suitable distro to accomplish this? Mac and VB is probably not the most efficient to run these, so please also suggest alternatives if you think that will help reach the goal.


title: Custom command wget without response

text: I have an arduino with an ethernet shield that is controlling a relay, which control the lights. I usually just use the phone to send a http get request from a widget in tasker, but I would like to be able to just type "light on" or "light_on" in the command line/terminal, and it would turn it on. I found that I could use `wget` to send the request `wget 192.168.1.177?s=1`, but that is listening for an output afterwards. But the arduino doesn't output anything, it just listens for the get. So in conclusion, I need to be able to make a custom command, and need a command to customize, to send an http GET request. Don't have to use `wget`, just seemed easiest since it was already installed. Oh, and my OS is Ubuntu 12. 04 LTS.


title: Finding root password

text: I installed a Ubuntu and it only has a user. I can login to the system without login. It doesn't ask me for un/pwd. but when I am in, and I want to run some commands as root (sudo), it ask for password and not allowing me to run it. No password works. How can I find password for this user or root?


title: Refresh aliases after defining new command

text: When I define new alias in `.bash_aliases` file or new function in `.bashrc` file is there some refresh command to be able immediately use the new aliases or functions without closing terminal (in my case xfce4-terminal with a few tabs open, many files open and in the middle of the work)?


title: Reference material about device management

text: Can anybody recommend materials about device management in the Linux environment? From the point where I insert a cdrom or usb device to the point where it is mounted in `/media/somedir`. I know that I must read about hal, dbus, udev but I was wondering is there any material that treats this topic as a whole. EDIT: Thanks for link but I want explore this topic more deeply, for example: from who udev get message that there is new device. How this process works etc.


title: How do I execute a command on a given string in each line of a file?

text: Let's assume that I already have a file created. This file creation comes from the execution of a command. The contents of the file will be up to 4 different lines looking something like this:               LUN Path:  servernam:/vol/server_xx_t1_01_223_04/mssql01/server_StorageSystemLevel100.lun     LUN Path:  servernam:/vol/server_xx_t1_01_225_04/mssql01/server_StorageSystemLevel100.lun     LUN Path:  servernam:/vol/server_xx_t1_01_226_04/mssql01/server_StorageSystemLevel100.lun     LUN Path:  servernam:/vol/server_xx_t1_01_228_04/mssql01/server_StorageSystemLevel100.lun      How can I pipe/awk/whatever this file so I can get the second string, i.e. "servernam:/vol/serverxxxx", and then run a command like:               rm  servernam:/vol/server_xx_t1_01_228_04/mssql01/server_StorageSystemLevel100.lun      So I want to pull the right string out of the file and include it as an argument to a command. Note that I would need to do the same execution command against all 4 different strings. A script example, or even better all from the command line, would be much appreciated.


title: How can I upgrade a package recursively in Arch Linux?

text: Is there any equivalent to FreeBSD's `portupgrade -R` in Arch Linux?   From `man portupgrade`: > >      -R >      --upward-recursive     Act on all those packages required by the given >                             packages as well. >


title: How to install compiler and binutils on FreeNAS?

text: I'd like to run a backup tool, duplicity, that apparently requires a `cc` compiler and `binutils`. I'm able to locate and install the required BSD packages for python, gcc, and dependencies from ftp2.freebsd.org. However, I can't find `binutils`. How are `binutils` installed on a system like FreeNAS? I'm working with FreeNAS 0.70 (based on FreeBSD 7.2). I see several packages with `binutils` in the name, but it's not clear any of them are for my i386 platform. e.g. I see `i386-rtems-binutils-2.19.1`, but I can't find any info that suggests this is correct for my platform. Google results mention it's for realtime systems.


title: Where can I find Software for Unix/Linux that does X?

text: I'm looking for a program that does X and runs on unix (or at least on my particular unix system). Where can I look? Is there a more efficient way than a generic web search?


title: Permission denied (even as root) on a mounted ISO image with Furius ISO Mount

text: I mounted a ISO image with Furius ISO Mount. I cd to the mounted directory and tried to copy a file with `sudo cp file /dir` but cp writes error message > cp: cannot stat `file': Permission denied The permissions of `file` are `-r--r--r--` `sudo chmod 777 file` writes > chmod: cannot access `file': Permission denied Do you know where the problem could be?


title: How do I parse a string in bash into variables using a tab as the delimiter and preserve spaces?

text: I am in the process of writing a bash script to display various statistics, some of which come from a MySQL database. The pertinant code I'm having difficulty with is:               read min max rows <<< $(mysql $dbDatabase -u $dbUser -p$dbPass -B -N -e \         "SELECT MIN(\`DateTime\`), MAX(\`DateTime\`), COUNT(*) FROM $dbTable")     echo "Min Date:" $min     echo "Max Date:" $max     echo "Total Rows:" $rows      The result of its execution is:               Min Date: 2013-03-18     Max Date: 20:30:00     Total Rows: 2014-07-31 14:30:00 11225139      Which obviously is not what I intend (the DateTime value has been split) According to Google, `$IFS` should be the answer to my problem. Unfortunately, I'm still unsuccessful in parsing the results correctly.               IFS=$'\t' read min max rows <<< ...      The result is:               Min Date: 2013-03-18 20:30:00 2014-07-31 14:30:00 11225139     Max Date:     Total Rows:      I find this odd since `msyql -B | tr $'\t' 'X'` proves visually that the fields are separated by tabs. As a workaround, I can do something like the following to produce the desired output:               read min max rows <<< $(mysql $dbDatabase -u $dbUser -p$dbPass -B -N -e \         "SELECT MIN(\`DateTime\`), MAX(\`DateTime\`), COUNT(*) FROM $dbTable" \         | tr ' ' '.')     min=$(tr '.' ' ' <<< $min)     max=$(tr '.' ' ' <<< $max)          echo "Min Date:" $min     echo "Max Date:" $max     echo "Total Rows:" $rows      But that hardly seems elegant or the "unix way". Does anyone know what I'm doing wrong and why `$IFS` isn't working for me, and what the correct usage is to have clean (non-hacky) and understandable code?


title: Can I run multiple cores at different clock speeds?

text: I see the cores on an Intel i5 machine I'm looking at can only be run at the same clockspeed: `/sys/devices/system/cpu/cpu1/cpufreq/related_cpus` lists all of the CPUs. Setting cpu1's clockspeed changes cpu0's, as expected. Supposedly the AMD A6-4400M machine I'm running should be able to run each core at a different clockspeed:`/sys/devices/system/cpu/cpu1/cpufreq/related_cpu` only lists cpu1. When I set cpu1's clockspeed by using the performance governor and echoing 1400000 to `scaling_max_freq`, cpu0's clockspeed remains at 2700000 as expected. Cpu1's scaling_cur_freq reads 1400000 as expected. However, cpu1's `cpuinfo_cur_freq` reads 2700000. From benchmarking, it appears CPU1 is indeed still running at 2.7 GHz. Am I missing something, or is something broken? I'm running Linux 2.6.35, and passing `idle=mwait` in the kernel command line.


title: How to create memory-based disk in linux?

text: I need to have a very fast disk for keeping cache. How can I do that in Linux?


title: Wubi limitations

text: Hi there I am quite new to Linux. Initially I decided to use Linux on VM but now I want to have full fledged experience. But I don't want to partition my PC. Will Wubi work since Ubuntu is ok for me. Specifically I want to ask whether installation through Wubi will install full fledged Ubuntu with no capability compromised edition like Live CD?


title: any command that can format html or xml from shell?

text: There must be something on the lines of `sed`? Normally in `sed` you type something like:               echo day | sed s/day/night/       the shell prints "night". Is there something that can take a file (containing xml/html) or an xml/html string and return the formatted result for me? Ps: want to be able to use this from my editor...


title: is there a way to connect SAMBA and miniDLNA

text: I am quite new to both, SAMBA and DLNA, so I don't know if my attempt makes sense at all. But what I try to achieve is the following: I have a client, that supports DLNA and a server that is a computer running Debian (Wheezy). I would like to access files released on the server (using SAMBA) with the client. This way I could control which files in my home directory should be shared via DLNA and which should stay private. Therefore I thought of a solution where I put something like               media_dir= # some place whith all samba shares      in `/etc/minidlna.conf` I think in this tutorial (http://zeldor.biz/2012/01/dlna-minidlna-on-debian/) the author tries to do something similar. Is this possible?


title: Understanding top and load average

text: I'm observing a high load average on a certain machine (about 9) in all three load fields. I understand load as the number of processes in state "run" / currently desiring CPU time. Am I correct at reasoning that if N processes are running on my machine this cannot produce a load greater than N? Also, does the load count in respect to processes or threads? In other words, can a multithreaded process produce a load greater than 1?


title: run xmodmap commands after login

text: I created a file `~/.Xmodmap` with my mapping commands. I thought that it will be automatically launched after login (and restart) but it's not. So I have to always run after login the command `$ xmodmap .Xmodmap` Is it possible to automatize this process? thank you


title: Why did my crontab not trigger?

text: I used `crontab -e` to add the following line to my crontab:               * * * * * echo hi >> /home/myusername/test      Yet, I don't see that the test file is written to. Is this a permission problem, or is crontab not working correctly? I see that the cron process is running. How can I debug this? **Edit** - Ask Ubuntu has a nice question about crontab, unfortunately that still doesn't help me. **Edit 2** - Hmm, it seems my test file has 214 lines, which means for the last 214 minutes it has been written to every minute. I'm not sure what was the problem, but it's evidently gone.


title: Console CPU utilisation chart

text: I need to monitor CPU and network utilisation from a terminal. For network traffic, I have found the perfect tool:   * slurm It gives me a moving chart. It gives me an nCurses-like UI I can use from a tty. Here's a screenshot: http://www.ubuntugeek.com/images/slurm.png Is there a `slurm` equivalent showing CPU utilisation?


title: Dell battery performs worse under Linux

text: I have recently bought a Dell XPS Touch. I'm dual booting Windows 7 with Fedora 16 (Verne). Right out of the box, Fedora reports 1 hour 26 minutes of battery life at full charge, while Windows reports a whopping 4 hours!! Why is this happening? Am I missing some `acpi` module or something? A friend suggested to me that this could be due to the fact that I'm using `nouveau` instead of the proprietary `nvidia` driver. Does that sound reasonable? **Update** I am now on Debian Wheezy and still the issue persists. Removed Fedora tag.


title: How can I test the encoding of a text file... Is it valid, and what is it?

text: I have several `.htm` files which open in Gedit without any warning/error, but when I open these same file in `Jedit`, it warns me of invalid UTF-8 encoding... The html meta tag states "charset=ISO-8859-1"   Jedit allows a _List of fallback encodings_ and a _List of encoding auto- detectors_ (currently "BOM XML-PI"), so my immediate problem has been resolved. but this got me thinking about: "What if the meta data wasn't there?" When the encoding info is just not available, is there a CLI program which can make a "best-guess" of which encodings may apply? And, although it is a slightly differnt issue; is there a CLI program which tests the validity of a _known_ encoding?


title: What is an integer between the square brackets after the command name in ps output?

text: I have a PC running Debian Wheezy and if I execute `ps -o command -p 1` then there is a 2 between the square brackets after the command name for `init` process:               root@vserver:~# ps -o command -p 1     COMMAND     init [2]       root@vserver:~#       While I know that square brackets around the process name in `ps` output mean that command does not have arguments, then what does the integer between the square brackets after the command mean?


How to get the char at a given position of a string in shell script?


title: Get the last executed command line in ksh

text: Is there a way to get the last executed command possibly together with the arguments within a ksh script? I am using mksh with cygwin. I tried `fc -nl -1`, but the script throws a "“fc: history functions not available” error. I don't see an equivalent of the `BASH_COMMAND` variable in ksh. Here is the excerpt from the script :               function trapper ()     {       printf "culprit: "       fc -nl -1     }          trap trapper ERR          grep -ic textdoesntexist test3      trapper executes once grep returns 1 , but I get a fc: history functions not available error. As pointed out by Lee, `hist` might be useful , but it is available only with ksh93, which I am not allowed to use. I tried by storing the command line string in a variable and use that variable within the trapper function.               function err_handler     {             echo "ERR in ${cmd} trapped"             cmd=             return 0     }          trap err_handler EXIT ERR          cmd="grep -ic testdoesntexist test3"     ${cmd} &>/dev/null      It works, but I kinda think it is ugly. Is there a better way out?


title: sixteen digit colour code?

text: I am trying to convert the mac4lin awn theme from 0.3 to 0.4 so it will work in my awn. But I'm not sure about the colour codes in the 0.4 files. They are not normal hex codes, they are sixteen digits and look like this:               ghistep1 = #f2f2caca00001212     ghistep2 = #f2f2caca00001212      The ones in the 0.3 look like this:               glass_histep_2 = FFFFFF00     glass_histep_1 = FFFFFF2C      How do I convert the colour codes? What are they?


title: Where has the trailing newline char gone from my command substitution?

text: The following code best describes the situation. Why is the last line not outputting the trailing newline char? Each line's output is shown in the comment. I'm using _GNU bash, version 4.1.5_                    echo -n $'a\nb\n'                  | xxd -p  # 610a620a                  x=$'a\nb\n'   ; echo -n "$x" | xxd -p  # 610a620a          echo -ne "a\nb\n"                  | xxd -p  # 610a620a     x="$(echo -ne "a\nb\n")" ; echo -n "$x" | xxd -p  # 610a62


title: How to port printer settings between different distributions?

text: My wife's netbook has two distributions installed on it: OpenSUSE 11.4, which she no longer uses much, and Debian testing. The only reason why OpenSUSE is still installed is that, for some odd reason, it was remarkably easy to set up printing. My wife did it, and I do not know how she did it. As regards Debian, despite about an hour of my messing with `dpkg` and `apt- get`, installing this or that driver from the repositories, this or that package from the manufacturer's website, printing documents only _renders_ documents in Debian testing (the printer is a Brother HL-20XX). I don't know how to grab the error messages that might be arising from this, as it's all happening in the GUI, but would gladly supply them given knowhow. So, how portable are printer settings between distributions, given that it's the same hardware, same architecture, etc.? Can I just move some files and folders around? Edit some text here and there? Or am I in for more headaches?


title: e4rat in Fedora 15

text: Has anyone tried installing e4rat and optimizing boot-time in _Fedora 15_? This ext4 defragmenting and optimizing utility works wonderfully in _Debian_. I am wondering if someone has replaced _Fedora_ 's native `readahead-fedora` with `e4rat` and compared the results. Reference: Lifehacker's e4rat article.


title: after BIOS splash, will not boot, asked to select OS, but can't

text: I'm running Linux Mint 13 MATE 64-bit. Everything has been working for several weeks. Yesterday, when I tried to boot up my computer, after the BIOS screen flashes I reach a screen with a black background that reads at the top: **GNU GRUB version1.99-21ubuntu3.4** Then there is a box in which I can select from the following lines:               Linux Mint 13 MATE 64-bit, 3.2.0-31-generic (/dev/sdb2)          Linux Mint 13 MATE 64-bit, 3.2.0-31-generic (/dev/sdb2) -- recovery mode          Previous Linux versions          Memory test (memtest86+)          Memory test (memtest86+, serial console 115200)      At the bottom it reads:               Use the ↑ and ↓ keys to select which entry is highlighed. Press enter to boot the selected OS, 'e' to edit the commands before booting or 'c' for a command-line.      I have no idea why it started doing this and, worse, I have no idea how to get out of here. No matter which option I select, I can't get it to boot the OS. If I select either of the first two, it reboots to splash the BIOS and then I'm right back where I started. If I choose "Previous Linux versions" I get essentially the same screen with only two choices (which are the same as the first two choices listed above, Linux 13 MATE and the recovery mode). Again, choosing either one of those results in a reboot. If I try to run either of the memtest options, it reads:               error: unknown command 'linux16',          Press any key to continue...      Then it brings me back to the same screen Can anyone help me please? Hardware Specification:   * Intel Core i5-2500;    * ASUS P8Z68-V LX Intel Motherboard;    * G. Skill Ripjaws series F3-12800CL9D-8GBRL (4GB x2);   * Plextor 128GB M5S Series SSD update: If I press 'e' it reads as follows:               setparams 'Linux Mint 13 MATE 64-bit, 3.2.0-31-generic (/dev/sdb2)'     recordfail     gfxmode $linnux_gfx_mode     insmod part_gpt     insmod ext2     set root = '(hd1,gpt2)'     search --no-floppy --fs-uuid --set=root 249aaa9-029d-4599-b25d-92003c49e087         linux /boot/vmlinuz-3.2.0-31-generic root=UUID=2492aaa9-029d-4599-b25d-92003c49e087 ro \quiet splash $vt_handoff      initrd /boot/initrd.img-3.2.0-31-generic


title: How can I run a process in a terminal window and then hide that window?

text: I want to run `python ~/program/proxy.py` in a terminal when I boot up. And then hide this terminal window (because it is just a proxy program, and I don't want to see the debug info). So how can I get it to work?


title: Is there a Ytalk IM successor?

text: Back in the stone ages, when men were men and women were women and Unix's competitor was VMS, Unix had a lovely talk (or ntalk, or ytalk) split screen IM command where you could talk **and both parties could see what was being typed character by character, live** (modulo netlag). No newer IM program I am aware of offers more than a throbber indicating the other party is typing. Are there any successor IM's that work like the older talk/ytalk/ntalk family? My understanding is that now they are hard to get working at all and deprecated as suffering chronic buffer overflow vulnerabilities. But the basic functionality they offered has something I have not seen in any IM I know of. If there is not a successor, is there a way to get one of those family working on a Linux or NetBSD box so that users who have shell accounts and are logged in can talk via a command line login session?


title: Span a directory on an SD card and an attached USB stick

text: Can I span a folder on the SD card on my Raspberry Pi with a folder on an attached USB device? I'd like to basically extend the size of a directory by using an attached USB memory stick. I'm running Debian wheezy.


title: Modify an incoming mail from text/plain to text/html

text: I'm using mutt to process my mail. There is one sender which declares the wrong content type. The mail arrives with               Content-Type: multipart/alternative;       boundary=--…      and has two parts. They are declared as:               Content-Type: text/plain; charset=utf-8      and               Content-Type: text/html; charset=utf-8      However both parts of the mail are same. So the plaintext part is full of HTML tags as well as the HTML part. I've tried to discuss it with the sender, but they use some kind of 'enterprise' software where they cannot change those settings. So I'd like to change the mail locally and maybe remove the `text/plain`-part or rewrite `text/plain` to `text/html`. What do you consider the best way and what tools can I use to get a readable mail in my case?


title: Preseeding Debian Install From Local Mirror: No Disks Detected

text: As a follow up to this question, I am trying to fully automate the Debian (squeeze) installation procedure. I have so far managed to mount an ISO image of the main Debian DVD and serve it over FTP to the client. The thing is, the client freezes while trying to detect hard drives. After a certain timeout interval, it presents me with a (blank) list of the partitions it detected and gives me the choice to either edit the partitions or continue. Both choices of course fail since no partitions are ever detected. To try and debug, I booted the host from the Debian DVD itself and opted for an Expert Install with low debconf priority. One of the steps done during that install seems to be the magical one: it's called "Download Installation components from CD". This seems to retrieve many more modules than my preseeded attempt does, eventually leading to a successful disk detection. In particular, it seems that this step scans the "pool" directory of the Debian mirror that's on the DVD, which the preseeding does not. I have already tried walking through the whole installation manually and retrieving the `d-i` selections with                debconf-get-selections --installer > installer_sels.txt      but nothing I found there was particularly helpful. The messages in VT 4 (`/var/log/syslog`) are not much help either because in both cases (the actual DVD and the FTP ISO mount) the messages and complaints about missing modules are the same. What am I missing here? Is there something I can add to the preseeding file to let it load additional modules from the DVD? Any advice from someone who's tried this before? Relevant lines from my preseeding file:               d-i mirror/protocol string ftp     d-i mirror/ftp/hostname <FTP server IP>     d-i mirror/ftp/directory /<FTP dir>/debian      * * * EDIT: Additional Details   * I followed this HowTo   * I'm serving the Debian squeeze DVD over FTP. I did the following to make an ISO image of it: `dd if=/dev/cdrom of=/path/to/debian_amd64.iso`   * I'm booting from the amd64 netboot/netboot.tar.gz image.   * My boot parameters are `... linux26` `append ... auto=true priority=critical preseed/url=ftp://path to preseed` I added the `linux26` deliberately to overcome the old kernel issue based on an answer I read somewhere else (can't remember where at the moment).


title: Reload Vim highlight setting and colorscheme

text: If I change Vim's `highlight` setting, how do I "reload" it for colorschemes to take effect? So, in my case, I remove `highlight`'s cursor line number—               se hl-=N:CursorLineNr      Changing `highlight` from— > > highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:Mor > eMsg,M:ModeMsg,n:LineNr, **N:CursorLineNr** > ,r:Question,s:StatusLine,S:StatusLineNC,c:Vert > Split,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:D > iffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:Spel > lCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine, > #:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn To > > highlight=8:SpecialKey,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:Mor > eMsg,M:ModeMsg,n:LineNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v > :Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:DiffAdd,C:DiffCh > ange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRar > e,L:SpellLocal,+:Pmenu,=:PmenuSel,x:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_: > TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn (I've emphasized the change.) But the cursor line number is still "highlighted"! Changing `highlight` doesn't update the colorscheme—so how do I "force" an update? I've tried setting syntax coloring off then on again and changing colorschemes to no avail. (Cross-posted from StackOverflow.)


title: How to get rid of special characters in the output of make on centos

text: I installed centos6.3. When I run gcc, it outputs errors but the function names are surrounded by special characters like this â€˜setup_connectionâ€™: This same is repeated with variable names. I am wondering if the terminal settings have to be changed. I am currently using ssh to login to the machine. Any inputs valuable


title: Can MD cope with a badblock list?

text: I have a MD drive set in RAID6 configuration with LVM2 on top. One of my drives was faulted last night due to bad blocks. Now apart from the fact that I am aware I should physically replace the drive, I am wondering: Can I feed MD a list of badblocks (such as I can with mke2fs -l [badblockslist]) in such a way that the these blocks are no longer used and effectively extend the life of the disk?


title: How can I get an ELO Touch Screen to work?

text: I have bought a new touchscreen POS machine and I have installed fedora 14 on it. I couldn't make the touch screen work, as the ELO touch manufacturers have drivers only for kernel 2.6.14 versions. Even though Fedora 14 has precompiled kernel-level driver support for ELO touch screens, I am unable to get it working. I have tried the `xorg.conf` configuration as well, but nothing is working.               Section "Files"               FontPath        "/usr/share/fonts/X11/misc"               FontPath        "/usr/X11R6/lib/X11/fonts/misc"               FontPath        "/usr/share/fonts/X11/cyrillic"               FontPath        "/usr/X11R6/lib/X11/fonts/cyrillic"               FontPath        "/usr/share/fonts/X11/100dpi/:unscaled"               FontPath        "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"               FontPath        "/usr/share/fonts/X11/75dpi/:unscaled"               FontPath        "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"               FontPath        "/usr/share/fonts/X11/Type1"               FontPath        "/usr/X11R6/lib/X11/fonts/Type1"               FontPath        "/usr/share/fonts/X11/100dpi"               FontPath        "/usr/X11R6/lib/X11/fonts/100dpi"               FontPath        "/usr/share/fonts/X11/75dpi"               FontPath        "/usr/X11R6/lib/X11/fonts/75dpi"       #path to defoma fonts       FontPath        "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"        EndSection        Section "Module"        Load    "i2c"        Load    "bitmap"        Load    "ddc"        Load    "dri"        Load      "extmod"        Load    "freetype"        Load    "glx"        Load    "int10"        Load    "vbe"         EndSection            Section "InputDevice"       Identifier      "Generic Keyboard"       Driver          "kbd"       Option          "CoreKeyboard"       Option          "XkbRules"      "xorg"       Option          "XkbModel"      "pc104"       Option          "XkbLayout"     "us"       EndSection            Section "InputDevice"       Identifier      "Configured Mouse"       Driver          "mouse"       Option          "CorePointer"       Option          "Device"                  "/dev/input/mice"       Option          "Protocol"              "ImPS/2"       Option          "Emulate3Buttons"       "true"       EndSection            Section "InputDevice"       Identifier "ELO touchscreen"       Driver "elographics"       Option "Device" "/dev/ttyS0"       Option  "MinX" "375"       Option  "MaxX" "3700"       Option  "MinY" "500"       Option  "MaxY" "3590"       Option  "UntouchDelay"  "10"       Option  "ReportDelay"   "10"       Option  "SendCoreEvents"        "yes"       Option  "ScreenNumber"  "0"       Option  "ButtonNumber"  "1"       EndSection            Section "Device"       Identifier      "Intel"       Driver          "intel"       BusID           "PCI:0:2:0"       EndSection          Section "Monitor"       Identifier      "LCD Touch"       Option          "DPMS"       EndSection            Section "Screen"       Identifier      "Default Screen"       Device          "ATI Technologies Inc ATI Default Card"       Monitor         "ELO Touch"                     DefaultDepth    24               SubSection "Display"               Depth           1               Modes "800x600"               EndSubSection               SubSection "Display"       Depth           4       Modes           "800x600" "720x400" "640x480"       EndSubSection       SubSection "Display"       Depth           8       Modes           "800x600" "720x400" "640x480"       EndSubSection       SubSection "Display"       Depth           15       Modes           "800x600" "720x400" "640x480"       EndSubSection       SubSection "Display"       Depth           16       Modes           "800x600" "720x400" "640x480"       EndSubSection       SubSection "Display"       Depth           24       Modes           "800x600" "720x400" "640x480"       EndSubSection       EndSection            Section "ServerLayout"       Identifier      "Default Layout"       Screen          "Default Screen"       InputDevice     "Generic Keyboard"       InputDevice     "Configured Mouse"       InputDevice     "ELO touchscreen" "SendCoreEvents"       EndSection            Section "DRI"       Mode    0666       EndSection


title: Which Linux distribution is suitable for serverside development and somewhat easy to use?

text: I need to setup a Linux-based server which is going to be the backend for our web services. This is what I need: (In order of importance)   1. A GUI to manage applications and files   2. It would be running a custom built C++ server   3. Probably also the LAMP stack, if needed.   4. I would be trying out ERP or other serverside software on it also (optional). Which Linux distribution do you recommend for such a use-case, considering I'm not an expert at any Unix-like OS (a week of experience with CentOS, some experience with Ubuntu). This is what I understand about each distro:   * **Ubuntu** - easy to use, the most popular, easy to install apps, no hassle   * **Debian** - older, but might be tough to configure   * **CentOS** - troublesome, hard to install apps   * **Mint** - popular, based on Ubuntu and Debian * * * **Edit:** I have a lot of people recommending Ubuntu over CentOS(1, 2) for serverside apps. Is Ubuntu fine for such things? Its not slower than CentOS or anything troublesome? And should I go with Ubuntu or Ubuntu Server? what are the advantages of either? > "Software installation is a breeze on Ubuntu. Even the server applications > come with decent default configurations and are normally usable out-of-the- > box. It's a software paradise."


title: gpg-agent asks for a passphrase, but ssh private key doesn’t have one

text: I am migrating from ssh-agent to gpg-agent now and I also have a bunch of ssh keys, which are loaded at startup. The keys do not contain passphrases, but after calling `ssh-add <filename>`, gpg-agent asks for a passphrase. Just pressing Enter works fine, but could it not ask for passphrases at all? At least for the keys not having one?


title: Device names for logical volumes

text: Consider this:               # fdisk -l /dev/sda          Disk /dev/sda: 298.9 GB, 298999349248 bytes     255 heads, 63 sectors/track, 36351 cylinders     Units = cylinders of 16065 * 512 = 8225280 bytes             Device Boot      Start         End      Blocks   Id  System     /dev/sda1   *           1          13      104391   83  Linux     /dev/sda2              14       36351   291884985   8e  Linux LVM      and this               # df     Filesystem           1K-blocks      Used Available Use% Mounted on     /dev/mapper/VolGroup00-LogVol00                          276883300   3610240 258981300   2% /     /dev/sda1               101086     19371     76496  21% /boot     tmpfs                  1993292         0   1993292   0% /dev/shm      _(The OS is Centos 5.5 64-bit, the HW is IBM ServeRAID M1015 using an LSI MegaRAID BIOS)_ Why does `df` use a long filesystem name instead of `/dev/sda2`?


title: org mode to dokuwiki converter

text: Is there an emacs org-mode to dokuwiki converter? Is there an dokuwiki to emacs org-mode converter?


title: Bash Script which can direct stdin stream to program

text: I am trying to create a script capable of infinitely processing an incoming stream which is piped to it, and continuous producing an output stream which can be piped to something else something as follows:               <infinitely produce data stream> | myscript | <use modified stream>      In my case, I have a program which will continously generate a headerless wav sinusoid which will be piped into my script which will mix it with other sinusoids, and pass it out to a program which will play it as it streams in. I have tried using               #!/bin/bash          while read data; do         #echo "data = $data"         ./merge <($data) <(./sine 1000)     done      But this just leaves crazy symbols all over my terminal. It looks like for everyline of stdin it receives, it calls merge again and again. My merge program is written in C and is written such that it is opening a file passed as an argument. It works fine when I run in in the terminal as               ./merge <(./sine 1000) <(./sine 2000) | ./audio_sink      This has two instances of sine running, generating 1kHz and 2kHz sine wave respectively, and merge reads the two input streams, mixes them, and produces an output to sdtout which can then be piped to audio_sink and I can hear it is working. In this script I'm writing I need to be able to pipe the input directing into the first argument as above. How can you write a bash script which allows you to use data continuously piped into it, manipulate it, and have the data piped back out?


title: Why is deleting files by name painfully slow and also exceptionally fast?

text: Faux pas: The "fast" method I mention below, is not 60 times faster than the slow one. It is 30 times faster. I'll blame the mistake on the hour (3AM is not my best time of day for clear thinking :).. Update: I've added a summary of test times (below).   There seem to be two issues involved with the speed factor:   * The choice of command used (Time comparisons shown below)    * The nature of large numbers of files in a directory... It seems that "big is bad". Things get disoprportionately slower as the numbers increase..  All the tests have been done with 1 million files.   (real, user, and sys times are in the test scripts)   The test scripts can be found at paste.ubuntu.com               #     # 1 million files                # ===============     #     #  |time   |new dir   |Files added in  ASCENDING order       #  +----   +-------   +-------------------------------------------------      #   real    01m 33s    Add files only (ASCENDING order) ...just for ref.     #   real    02m 04s    Add files, and make 'rm' source (ASCENDING order)      #                      Add files, and make 'rm' source (DESCENDING order)      #   real    00m 01s    Count of filenames     #   real    00m 01s    List of filenames, one per line     #   ----    -------    ------     #   real    01m 34s    'rm -rf dir'     #   real    01m 33s    'rm filename' via rm1000filesPerCall   (1000 files per 'rm' call)     #   real    01m 40s    'rm filename' via  ASCENDING algorithm (1000 files per 'rm' call)     #   real    01m 46s    'rm filename' via DESCENDING algorithm (1000 files per 'rm' call)     #   real    21m 14s    'rm -r dir'     #   real    21m 27s    'find  dir -name "hello*" -print0 | xargs -0 -n 1000 rm'     #   real    21m 56s    'find  dir -name "hello*" -delete'     #   real    23m 09s    'find  dir -name "hello*" -print0 | xargs -0 -P 0 rm'     #   real    39m 44s    'rm filename' (one file per rm call) ASCENDING     #   real    47m 26s    'rm filename' (one file per rm call) UNSORTED     #                                                             * * * I recently created and deleted **10** million empty test files. Deleting files on a name by name basis (ie `rm filename`), I found out the hard way that there is a **huge** time difference between 2 different methods... Both methods use the exact same `rm filename` command. > _Update: as it turns out, the commands were not exactly the same... One of > them was sending 1000 filenames at a time to 'rm'... It was a shell brace- > expansion issue where I thought each filename was being written to the > feeder file on a line of its own, but actually it was 1000 per line_ The filnames are provide via a 'feeder file' into a `while read` loop..   The feeder file is the output of `ls -1 -f`   The methods are identical in all reaspects, except for one thing:   * the **slow** method uses the unsorted feeder file direct from `ls -1 -f`   * the **fast** method uses a sorted version of that same unsorted file I'm not sure whether the sorting is ths issue here, or is it perhaps that the sorted feeder file just happens to match the sequence in which the files were created (I used a simple ascending integer algorithm) For 1 million files, the _fast_ `rm filename` method is **60** times faster than the _slow_ method... again, I don't know if this is a "sorting" issue, or a behind-the-scenes hash table issue... I suspect it is not a simple sorting issue, because why would `ls -1 -f` intentionally give me an **unsort** listing of a freshly added "sorted" sequence of filenames... I'm just wondering what is going on here, so it doesn't take me days (yes days) to delete the next 10 million files :) .... I say "days" because I tried so many alternatives, and the times involved increase disproportionatly to the numberof file involved .. so I've only tested **1** million in detail BTW: Deleting the files via the "sorted list" of names is actually faster than `rm -rf` by a factor of 2.   and: `rm -r` was 30 times slower than the "sorted list" method ... but is "sorted" the issue here? or is it more related to a hashing(or whatever) method of storage used by ext4? The thing which quite puzzles me is that each call to `rm filename` is unrelated to the previous one .. (well, at least it is that way from the 'bash' perspective) I'm using Ubuntu / bash / 'ext4' / SATA II drive.


title: regarding portable sed -e... d b or ! b?

text: In this edit Stéphane Chazelas _POSIXifies_ _(again)_ my `sed` formatting by inserting an `-e`xpression break and another `-e`xpression statement. Now, I might just ask him why in the comments, I suppose, but it is already revision number 18 on that answer and almost all of the previous ones were already thanks to similar freebies _(if you can see deleted comments you'll know what I mean)_. Also, I _think_ I'm near enough to understanding why to phrase this in a way that might be more generally useful. So here's hoping... I generally prefer to keep my total `sed` `-e`xpressions to one if I might, but I also have a greater preference for conforming to the spec as near as I can, especially when the difference amounts to no more than a `<space>` and an `-e`. But I cannot do this if I do not understand _why_ I should. Here's a brief rundown of the current state of my understanding:   * the `' -e '` break can portably stand in for a `sed` script `\n`ewline break in a `sed` command-line statement... _I am admittedly fuzzy about why_   * the closing brace in a `sed` `{` function `}` must be preceded by a `\n`ewline break as stated here:     * _The`<right-brace>` shall be preceded by a `<newline>` and can be preceded or followed by `<blank>` characters._   * a `\n`ewline break is similarly required following any use of... _`a`, `b`, `c`, `i`, `r`, `t`, `w`, or `:`._ But I do not understand clearly how the `{` function `}` definition relates to the `!`not operator. The only mention I find of the negation operator in the spec states:   * _A function can be preceded by one or more`!` characters, in which case the function shall be applied if the addresses do not select the pattern space._ Does this mean that use of a `!` implies `{` braces `}`? What of `$!`commands - should they likewise be separated by `' -e '` breaks? Was this what was addressed when Stéphane most recently _POSIXified_ my answer? I think it is either the `!`negation operator, or it is the `b`ranch statement he addresses in his edit - or possibly it is both at once - but I do not know and should like to. If it is _only_ the `b`ranch statement, then _I believe_ a `d` would do in its place and eliminate the need for the `' -e '` break, but I'd rather be certain before hazarding a thrice _POSIXified_ answer. Can you help? _I did risk itafter all, but not with any great certainty..._


title: How can I get KornShell to display the date and time in the prompt?

text: On my AIX box, which is using `ksh` as the default shell, I'd like the prompt to show both the date and time followed by a newline `\n`, along with the name of the machine, and the working directory. Something like:               2014/08/05 10:58:43     [username]machinename:/some/path/here $      I've tried the following:               unset _Y _M _D _h _m _s     eval $(date "+_Y=%Y;_M=%m;_D=%d;_h=%H;_m=%M;_s=%S")     ((SECONDS = 3600*${_h#0}+60*${_m#0}+${_s#0}))     typeset -Z2 _h _m _s     _tsub="(_m=(SECONDS/60%60)) == (_h=(SECONDS/3600%24)) + (_s=(SECONDS%60))"     _timehm='${_x[_tsub]}$_h:${_m}'     _timehms='${_x[_tsub]}$_h:$_m:${_s}'     _timedhms=$_Y'/'$_M'/'$_D" "'${_x[_tsub]}$_h:$_m:${_s}'          PS1="$_timedhms'\n' "'[USERNAME]MACHINE:${PWD#$HOME/} $ '      However, there is no newline between the date/time and the rest of the prompt. It seems now matter what the combination of quotes I try, I cannot get a newline to appear in PS1.


title: replace comma in specific column value

text: I have a file which contains 6 columns, each field separated by "I" the second last column contains amount field.               140121059|01/01/201400:00:45|[1390]|[387]|17.64|10     140121060|01/01/201400:00:46|[1112]|[867]|26.46|10     140121062|01/01/201400:00:47|[182]|[13]|4,117.60|10     140121065|01/01/201400:00:48|[1088]|[385]|1,147.04|10      I want to remove "," from the amount column as Im not able to put some operations on this column. "," is not coming in all columns. And Im using bash.


title: how to install yoono-desktop?

text: Just now i download yoono-desktop from http://www.yoono.com/desktop_features.html.While trying to install this app it showing error               [root@localhost mpatil]# yum install yoono-desktop     Loaded plugins: fastestmirror, refresh-packagekit, security     Loading mirror speeds from cached hostfile      * base: centos-hcm.viettelidc.com.vn      * epel: ftp.cuhk.edu.hk      * extras: mirrors.vonline.vn      * updates: centos.aol.in     Setting up Install Process     No package yoono-desktop available.     Error: Nothing to do      how to install this app on linux please tell me.


title: Installing mysql-server in vagrant bootstrap shell script (how to skip setup?)

text: I did try to install mysql-server on my Vagrant Ubuntu 12.04 LTS virtual machine. When I did so, the setup auto-starts. I can see this in the Vagrant output: > While not mandatory, it is highly recommended that you set a password ││ for > the MySQL administrative "root" user.││││ If this field is left blank, the > password will not be changed.││││ New password for the MySQL "root" user After that the output text goes haywire -- `± ├⎺ ⎼␊⎻┌▒␌␊ ┌␋␉⎽─┌␋├␊3-0 3.7.9-2┤␉┤┼├┤1 (┤⎽␋┼± ...` -- but is rather lengthy and full of green and red colors, so I believe the rest of the install is completing. But I can confirm the lack of install after:               sudo apt-get install --just-print mysql-server-5.5      ...     The following NEW packages will be installed:       mysql-server-5.5      How can I send the right signals through a shell script to configure the MYSQL server? Or if I cannot, how can I stop the automatic launching of the configuration or kill the setup once launched while still having the package installed?


title: BASH : Array as String Buffer

text: Instead of displaying (or writing) every result once generated, i designed an _Array_ based _Buffer_ to store data and write it whenever the line counter reaches a MAX value. Here is the script :               #!/bin/bash     #Buffer Management     BUFFERCURSOR=0     BUFFERMAXSIZE=5     function bufferReset (){         unset BUFFERVAR         BUFFERCURSOR=0     }     function bufferAppend () {         (( BUFFERCURSOR++ ))         BUFFERVAR[$BUFFERCURSOR]="$1"     }     function bufferDisplay () {         for ((i=1;i<=$BUFFERCURSOR;i++)); do printf "%s\n" "${BUFFERVAR[$i]}" ; done     }     #Buffer Management End:     for ((i=1;i<=8;i++)) ; do         line=`printf "%3s" "$i ==> $(echo $i | md5sum|awk '{print $1}')"` #Example of a string to append         bufferAppend "$line"         if [ "$BUFFERCURSOR" == "$BUFFERMAXSIZE" ] ;    then             bufferDisplay             bufferReset         fi     done     # Display remaining elements in the "buffer"     bufferDisplay     bufferReset      So the output is :               1 ==> b026324c6904b2a9cb4b88d6d61c81d1     2 ==> 26ab0db90d72e28ad0ba1e22ee510510     3 ==> 6d7fce9fee471194aa8b5b6e47267f03     4 ==> 48a24b70a0b376535542b996af517398     5 ==> 1dcca23355272056f04fe8bf20edfce0     7 ==> 84bc3da1b3e33a18e8d5e1bdd7a18d7a     8 ==> c30f7472766d25af1dc80b3ffc9a58c7      Why the 6th element is skipped ?


title: Fix EXT4-fs bad geometry (block count exceeds size of device)

text: I have a micro SD card which has a FAT32 partition and an EXT4 partition. The EXT4 partition will no longer mount. dmesg shows the following error:               EXT4-fs (sdb2): bad geometry: block count 2199023779840 exceeds size of device (524288 blocks)      I've Googled, but still don't fully understand where the problem is (in the partition table? the filesystem?) nor how to fix it. I have attempted a number of solutions:   * Using testdisk to write the partition table   * Using fsck to restore the superblock from the backups (I've tried all of them). e.g. `fsck.ext4 -b 163840 -B 4096 /dev/sdb2`   * Using `fsck -cc` to check for bad blocks   * Using resize2fs to set the size of the partition. Output: `The combination of flex_bg and !resize_inode features is not supported by resize2fs.` When I run fsck, it comes up with a bunch of errors (full output below), which it claims to fix. If I run it again, however, it shows the same errors all over again, every time. How can I fix the bad geometry issue and make my filesystem mountable again? How did this happen? fsck output:               e2fsck 1.42 (29-Nov-2011)     One or more block group descriptor checksums are invalid.  Fix<y>? yes          Group descriptor 0 checksum is invalid.  FIXED.     Group descriptor 1 checksum is invalid.  FIXED.     Group descriptor 2 checksum is invalid.  FIXED.     Group descriptor 3 checksum is invalid.  FIXED.     Group descriptor 4 checksum is invalid.  FIXED.     Group descriptor 5 checksum is invalid.  FIXED.     Group descriptor 6 checksum is invalid.  FIXED.     Group descriptor 7 checksum is invalid.  FIXED.     Group descriptor 8 checksum is invalid.  FIXED.     Group descriptor 9 checksum is invalid.  FIXED.     Group descriptor 10 checksum is invalid.  FIXED.     Group descriptor 11 checksum is invalid.  FIXED.     Group descriptor 12 checksum is invalid.  FIXED.     Group descriptor 13 checksum is invalid.  FIXED.     Group descriptor 14 checksum is invalid.  FIXED.     Group descriptor 15 checksum is invalid.  FIXED.     /dev/sdb2 contains a file system with errors, check forced.     Pass 1: Checking inodes, blocks, and sizes     Pass 2: Checking directory structure     Pass 3: Checking directory connectivity     Pass 4: Checking reference counts     Pass 5: Checking group summary information     Free blocks count wrong for group #0 (24465, counted=24466).     Fix<y>? yes          Free blocks count wrong for group #2 (4788, counted=5812).     Fix<y>? yes          Free blocks count wrong for group #3 (8710, counted=8881).     Fix<y>? yes          Free blocks count wrong for group #8 (5682, counted=22066).     Fix<y>? yes          Free blocks count wrong (299742, counted=317322).     Fix<y>? yes          Inode bitmap differences:  -(8193--8194) -8197 -8208 -(8225--8226) -8229 -(8240--8241) -(8257--8258) -8261 -8272 -8274 -(8289--8290) -8293 -(8304--8306) -(8321--8322) -8325 -8336 -8339 -16387 -16389 -16400 -16419 -16421 -(16432--16433) -16451 -16453 -16464 -16466 -16483 -16485 -(16496--16498) -16515 -16517 -16528 -16531 -24577 -24579 -24581 -24592 -24609 -24611 -24613 -(24624--24625) -24641 -24643 -24645 -24656 -24658 -24673 -24675 -24677 -(24688--24690) -24705 -24707 -24709 -24720 -24723 -(32770--32771) -32773 -32784 -(32802--32803) -32805 -(32816--32817) -(32834--32835) -32837 -32848 -32850 -(32866--32867) -32869 -(32880--32882) -(32898--32899) -32901 -32912 -32915 -(40961--40963) -40965 -40976 -(40993--40995) -40997 -(41008--41009) -(41025--41027) -41029 -41040 -41042 -(41057--41059) -41061 -(41072--41074) -(41089--41091) -41093 -41104 -41107 -(49156--49157) -49168 -(49188--49189) -(49200--49201) -(49220--49221) -49232 -49234 -(49252--49253) -(49264--49266) -(49284--49285) -49296 -49299 -57345 -(57348--57349) -57360 -57377 -(57380--57381) -(57392--57393) -57409 -(57412--57413) -57424 -57426 -57441 -(57444--57445) -(57456--57458) -57473 -(57476--57477) -57488 -57491 -65538 -(65540--65541) -65552 -65570 -(65572--65573) -(65584--65585) -65602 -(65604--65605) -65616 -65618 -65634 -(65636--65637) -(65648--65650) -65666 -(65668--65669) -65680 -65683 -(73729--73730) -(73732--73733) -73744 -(73761--73762) -(73764--73765) -(73776--73777) -(73793--73794) -(73796--73797) -73808 -73810 -(73825--73826) -(73828--73829) -(73840--73842) -(73857--73858) -(73860--73861) -73872 -73875 -(81923--81925) -81936 -(81955--81957) -(81968--81969) -(81987--81989) -82000 -82002 -(82019--82021) -(82032--82034) -(82051--82053) -82064 -82067 -90113 -(90115--90117) -90128 -90145 -(90147--90149) -(90160--90161) -90177 -(90179--90181) -90192 -90194 -90209 -(90211--90213) -(90224--90226) -90241 -(90243--90245) -90256 -90259 -(98306--98309) -98320 -(98338--98341) -(98352--98353) -(98370--98373) -98384 -98386 -(98402--98405) -(98416--98418) -(98434--98437) -98448 -98451 -(106497--106501) -106512 -(106529--106533) -(106544--106545) -(106561--106565) -106576 -106578 -(106593--106597) -(106608--106610) -(106625--106629) -106640 -106643 -114694 -114704 -114726 -(114736--114737) -114758 -114768 -114770 -114790 -(114800--114802) -114822 -114832 -114835 -122881 -122886 -122896 -122913 -122918 -(122928--122929) -122945 -122950 -122960 -122962 -122977 -122982 -(122992--122994) -123009 -123014 -123024 -123027     Fix<y>? yes          Free inodes count wrong for group #0 (7803, counted=7804).     Fix<y>? yes          Free inodes count wrong (130683, counted=130684).     Fix<y>? yes               /dev/sdb2: ***** FILE SYSTEM WAS MODIFIED *****     /dev/sdb2: 388/131072 files (22.7% non-contiguous), 206966/524288 blocks      `fdisk -l` output:               Disk /dev/sdb: 16.0 GB, 16012804096 bytes     64 heads, 32 sectors/track, 15271 cylinders, total 31275008 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x0005ce93             Device Boot      Start         End      Blocks   Id  System     /dev/sdb1   *        2048    27080703    13539328    c  W95 FAT32 (LBA)     /dev/sdb2        27080704    31275007     2097152   83  Linux


title: Is there anything wrong with using dnsmasq as a dhcp server instead of isc-dhcp-server?

text: So I've configured my home connections to work with dnsmasq since it bundles a dhcp server with it and is quite nice to set up. There is another package - isc-dhcp-... that also does this and perhaps is its intended purpose. What am I losing out on?


title: Truncate long lines in emacs from command line argument

text: I know the command in the `.emacs` for long line truncation is:               (setq-default truncate-lines t)      or the keystroke:               M-x <RET> toggle-truncate-lines <RET>      but how do I pass these as parameters launching emacs from the shell?


title: Virtual terminal switched when USB mouse plugged in Linux

text: Our machine runs a modified RedHat 9 (Kernel Linux 2.6.20-1.21, GNOME 2.10.0). When USB mouse is plugged in, the X Window will always switch out, we have to switch back by Alt + F7. There is no such problem with PS2 mouse. So, one line was added into _/etc/udev/rules.d/15-mouse.rules_ :               KERNEL=="mouse", BUS=="usb", SYSFS{product}=="Mouse", MODE="0660", NAME="input/mouse0", PROGRAM="/bin/sh -c 'chvt 8; chvt 7'"      But these days, we found this doesn't work for 2 machines. I have to use Alt + F9 to switch back to X Window. I am new to this, can anybody help me to understand:   1. Why virtual terminals are switched when USB mouse is plugged in?   2. I thought #7 virtual terminal is used for X window, why it is changed to #9? Thank you.


title: Change the order of displayed fields of arbitrary command output

text: How could I change the order of fields from a given command? As an example take the output of `ls -l`. By default the file name is displayed as the last field of the output. What could I pipe that output to in order to make the file name the first field shown? My initial thought was to use the cut command, but regardless of the order in which fields are passed to the -f option they're always outputted in the original order. Note: I'm only using `ls -l` as an easy example, but I'd like to find a general purpose idiom that could be used for any command that outputs data in columns. If it could also be applied to delimited data that would be great too.


title: Dropbox doesn't connect properly on boot

text: I'm having a problem with Dropbox (version 1.1.35). When I first boot it takes some time before Network Manager connects to the WLAN. Then I see the Dropbox icon in the task list, claiming to be "Connecting...", but never finishing. If I exit and start it again, everything works fine. Is there any way to fix this?


title: How to install Scala?

text: Please note: I have to use the source package, not the prebuilt package from the repo (it is broken, at least IDEA complains). From the page: http://www.scala-lang.org/downloads I downloaded `scala.final.tgz` package. I installed it by unpacking to `/usr/local/share`. However, when I run IntelliJ IDEA and point to this directory it complains about missing `/doc/scala-devel-doc...` (maybe there is something more missing, but IDEA cuts off the rest). I also downloaded `scala.final-devel-docs.tgz` but it complains about the same missing file. In none of those packages are any instructions on how to install scala. The scala web page also lacks any information how to install it (except for a remark that the `tgz` file can be unpacked with `tar`). openSUSE 11.4, IntelliJ IDEA 10.5.2. ## Solution, use Eclipse Luke... _As the life goes on, it appears I tend to avoid broken ideas/products/etc altogether, instead of fixing them._ Anyway, maybe someone will find it useful.   * IntelliJ didn't complain about missing .jar package but missing subdirectory   * you can download docs extra package manually and then unpack it to the directory YOUR_SCALA_MAIN_DIR/doc/scala-devel-docs (watch for the naming, tgz file has some naming added -- rename it after unpacking)   * the installation "instruction" is completely wrong -- the first command does not test anything, it installs extra package   * once installed, you cannot test installation, because you won't have enough rights for the system files -- and testing something at the system level as root... not clever   * and besides, it wouldn't even work because the code expects files in different location that you are assumed to be (easy to fix, though)   * and on top of that IntelliJ still won't run your code! And now for comparison -- in Eclipse (despite all comments about very unstable Scala plugin) not only I didn't have to configure anything, not only my own test code was compiled in an instant (IntelliJ takes **some** time), but also it was executed, and ran without any errors. Same Scala was used. How about difference? **@user unknown, thank you very much for your help!** Thanks to you I have more complete Scala installation. ## ...or IntellIJ After some struggle I managed to set up IntelliJ as well. Maybe there is simpler way, but this worked for me:   * install Scala   * install IntelliJ   * install Scala plugin   * create Scala dummy project   * quit IntellIJ   * go to your personal settings IntelliJ directory   * edit config/options/applicationLibraries.xml   * there should be 3 sections -- one with empty label, one for compiler, one for library, delete entirely the first section (with empty label)   * run IntelliJ again, that's it I installed IntellIJ along with Eclipse, because Eclipse has very strange way of treating projects.


title: Linux installation stuck at the start up because of nvidia graphic cards

text: I have a problem with installation of Linux Mint 17 on Lenova Thinkpad T430. It has 2 graphic cards nvidia and intel graphic cards. When I try to install it from a bootable disk, it gets stuck at the beginning of the installation. I searched on the web for the solution and found out that nvidia is preventing installation of mint distro. I tried a solution which seemed to be working in the first case and let me install the Mint alongside Windows 7. Everything was fine until I restart the computer. This time it stocked again at the start up with same problem. When I run in recovery mode of Mint, it gives me an error saying that there is a problem with graphic card driver. I also installed recommended nvidia driver from device driver menu, it did not work. What can I do to resolve this? EDIT: Since I have also windows 7, it is not important to disable completely all nvidia functions from computer. When I need nvidia, I can use it on Windows 7. So disabling nvidia also will solve my problem.


title: Possible to extract title and pagenum of each page in a pdf file

text: I was wondering if there are some ways to extract title and pagenum of each page in a pdf file? Either by some applications, or by programming in some programming language with some pdf libraries? The title of each page is supposed to be the first line of the page, for example, in slides/presentation files. The output is supposed to be a text file, with following format:               title_of_first_page pagenum_of_first_page     title_of_second_page pagenum_of_second_page     ...      Thanks and regards!


title: Mounting from dolphin vs commandline

text: I have been wondering how this is possible (i.e. how this works internally). When you want to mount a directory you have to be root.               sudo mount /dev/something /mnt/somedir      I know you can get around that by adding a line in fstab. Now, I'm wondering how come if I insert let's say an usb stick and select it from within Dolphin (KDE's filemanager), it mounts it without the need for a root password and gives me write/read access to what it has mounted? I'm guessing it is using dbus to monitor for new devices. I don't see how (when it knows there is something it should be mounted) it can mount it without the need for root. I haven't yet figured out how to manually mount some device without root and maybe I can learn something from how Dolphin does it.


title: Best way to mount remote folder

text: I have two RasberryPi running debian wheezy and I would like to mount a folder from computer A on computer B. What is the best (as in most efficient) way to do this? I can do it via SMB, but that is for windows, I think there must be a better way to share across linux.


title: Debugging dmesg logs

text: I noticed I have the following in my logs. I just am not sure as to how to go about figuring out how to fix or find out what is causing them and if they are serious.               [582046.956291] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 18482 0 0 1379281138 e pipe failed     [582346.769892] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 21093 0 0 1379281439 e pipe failed     [582646.586134] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 23723 0 0 1379281739 e pipe failed     [582946.390029] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 26342 0 0 1379282039 e pipe failed     [583246.202851] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 29010 0 0 1379282340 e pipe failed     [583546.018408] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 31620 0 0 1379282640 e pipe failed     [583845.836688] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 1837 0 0 1379282940 e pipe failed     [584145.645968] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 4416 0 0 1379283241 e pipe failed     [584445.455705] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 7001 0 0 1379283541 e pipe failed     [584745.266532] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 9600 0 0 1379283841 e pipe failed     [585045.074399] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 12209 0 0 1379284141 e pipe failed     [585344.885464] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 14790 0 0 1379284442 e pipe failed     [585644.743818] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 17605 0 0 1379284742 e pipe failed     [585944.511572] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 20183 0 0 1379285042 e pipe failed     [586244.315990] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 22781 0 0 1379285343 e pipe failed     [586544.123020] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 25385 0 0 1379285643 e pipe failed     [586843.932084] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 27984 0 0 1379285943 e pipe failed     [587143.742379] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 30608 0 0 1379286244 e pipe failed     [587443.559349] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 799 0 0 1379286544 e pipe failed     [587743.373027] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 3420 0 0 1379286844 e pipe failed     [588043.175248] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 6031 0 0 1379287145 e pipe failed     [588342.986730] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 8665 0 0 1379287445 e pipe failed     [588642.795951] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 11279 0 0 1379287745 e pipe failed     [588942.608088] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 13915 0 0 1379288045 e pipe failed     [589242.420741] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 16728 0 0 1379288346 e pipe failed     [589542.235065] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 19355 0 0 1379288646 e pipe failed     [589842.061502] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 21998 0 0 1379288946 e pipe failed     [590141.856687] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 24657 0 0 1379289247 e pipe failed     [590441.700335] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 27307 0 0 1379289547 e pipe failed     [590741.483298] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 29944 0 0 1379289847 e pipe failed     [591041.286647] Core dump to |/usr/libexec/abrt-hook-ccpp 7 0 32554 0 0 1379290148 e pipe failed


title: Unable to switch back from tty1-tty6 to tty7?

text: I'm using Linux Mint Debian Edition with Cinnamon. If I switch to another tty using `Ctrl` + `Alt` + `F#` and then switch back to tty7, I only see the terminal with this error:               [FAIL] startpar: services returned failure: plymouth ... failed      I checked in the dmesg, daemon.log, lastlog, messages, user.log, and Xorg.0.log and I don't see the error anywhere. I'm forced to switch back to another tty and restart mdm (Mint Display Manager) to get back to the log in screen (and thus losing whatever I was working on). How do I fix this? I thought Plymouth was merely for setting the resolution as early as possible in the boot process. I did post a similar thread at the LM forums, but haven't received any word yet.


title: Filtering redundant paths from a list of paths

text: I have a list of relative paths such as this:               dir1     dir2     dir2/dir3     dir2/file1     dir3/file2     dir3/dir4     dir3/dir4/file3      In the example above, the specifier `dir2/file1` (for example) is redundant, because the `dir2` entry would include this file. Want I want to do, essentially, is remove redundant paths from a given list of paths. The above example would output the following:               dir1     dir2     dir3/file2     dir3/dir4      Note that the files and directories specified need not actually exist on the filesystem. I am willing to use any common Unix command (sed, awk, perl, etc.).


title: Adding dropbear to initramfs with dracut on Fedora

text: I'm trying to add dropbear to my initramfs so I can unlock the encrypted disk through a remote SSH session (as described here). I'm running Fedora 16 which apparently uses dracut to generate the initramfs image. Can anyone explain (or provide a link) how to add dropbear to initramfs using this setup? **Update:** I've been trying to learn more about dracut, but I'm finding that there's not a ton of information out there. Here is my current understanding, if anyone can comment on this:   * I need to create a new dracut module which installs a pre-mount hook into the initramfs image.   * The pre-mount hook will start the dropbear server, before any attempt is made to unlock/mount the LUKS filesystem (which presumably occurs during the "mount" phase).   * With dropbear started, I should be able to SSH to the server and provide the passphrase to unlock it, as describe in the other post.   * I also need to add a pre-pivot hook that will stop the dropbear server before the boot process chroots to the final root partition.


title: Sudden crash and black screen in Ubuntu, possible overheating

text: I recently installed Ubuntu 13.10 64 bit (dual boot with Win 7) on my desktop PC, but every once in a while the screen turns off suddenly, the fans slow down, and the system appears to crash. I can't see what actually happens, because the screen turns off (no input), but the sound crashes too. All I can do is to press the reset button on the computer itself, after which it boots up without any issue or mention of a problem. At first this happened randomly and unexpectedly simply from normal use, just by opening Firefox or moving the cursor around the desktop right after a clean install. Now it seems to happen only when I do something CPU intensive, like watching videos or importing my music library. I'm not sure what changed, because all I did was turn it off for a day and then come back. I've since cleaned the inside of the computer for dust, and all fans appear to be spinning. The system specs are: AMD Phenon II X4 965 3.4 GHz ATI Radeon HD 4870, and Ubuntu says the driver is Gallium 0.4 on AMD RV770


title: How does a BIOS password work?

text: I have created a BIOS password. I use the Dvorak keyboard layout. When I switch my keyboard layout to Qwerty and restart, and then type password in with the different layout, there is no change. However, when I'm logged into my OS, having a different keyboard layout matters. What's going on here?


title: Vim autocommand creates weird file

text: I've just set up slackware 14 on a virtualbox. As one does, I immediatly created/altered my `.bashrc` and, more importantly, my `.vimrc` files. To avoid writing huge lines of code, I usually add something like               au BufWinEnter * w:m1=matchadd('ErrorMsg','\%>100v.\+', -1)     if version >= 702         au BufWinLeave * call clearmatches()     endif      I've used these settings for quite a while now, only this time, whenever I open a file in vim, a weird file is being created, with `:m1=matchadd('ErrorMsg','\%>100v.\\+', -1)` as its name.   I've reduced my `.vimrc` file to just the basics, which I believe can't have anything to do with this oddity (vim-7.3.645-x86_64-1):               set nocompatible     set ai     set nu     set ruler     set hlsearch     set hidden     set showcmd     set cursorline     set confirm     syntax on     color evening     au BufWinEnter * w:m1=matchadd('ErrorMsg','\%>100v.\+', -1)     if version >= 702         au BufWinLeave * call clearmatches()     endif      Any ideas what is causing this behaviour, and how to fix it?


title: How to reduce and remove Physical Volume from active Logical Volume?

text: For testing purposes I've tried to extend my logical volume by attaching one more Physical Volume (USB drive). Making the USB drive part from the logical volume with the following steps:   * Created partition from the device   * Created Physical Volume from the new partition   * Attached the Physical Volume to the already configured Volume Group   * And finally extending the Logical Volume My question is how to unmount and remove the USB drive without losing any data on the already existing Logical Volume?


title: Find out if computer started via Wake-on-LAN or power button?

text: Is there any (reliable) way to find out if the PC booted because of a Wake-on- LAN Packet instead of pressing the power button? I want automatically check if WOL is correctly configured. I know about `ethtool`'s WOL output, but this just tells me if WOL is turned on, not how the PC booted, right?


title: How to know if a specific program is open

text: Using a command line in terminal, I want to be displayed `1` if a program (for example Firefox or Chromium) is open and `0` otherwise. Edit: By "open", I mean "is running on the current machine and has a window open on the X server that I am seeing"


title: Cross button became invisible after installing compiz

text: I'm using Linux Mint with Xfce 14. I installed an old version of Compiz by mistake, but it was working fine. Then I decided to install the latest version, but after installing it the "Close" and "Minimize" buttons are not visible anymore. How can I make them appear again?


title: Allow a specific user or group root access without password to /bin/date

text: As the title would suggest, I'd like to give a user or group full root access to the /bin/date command, including any manner of arguments as defined in the man pages. I understand `/etc/sudoers` expects explicit command definitions, so currently I have the following:               %some_group ALL=(root) NOPASSWD: /bin/date      e.g. I want any user in some_group to be able to run:               sudo /bin/date +%T "12:34:56"      Plus countless other combinations of arguments. I guess my question is, is there a way to use regex or safe (emphasis on safe!) wildcards to achieve the finer granularity? **UPDATE** I managed to achieve something similar with Cmnd_Alias. Why this doesn't work without is a mystery beyond having time to read further on the inner-workings of `sudo` and sudoers. Your syntax wasn't quite accepted, but I managed to achieve what I needed with the following:               Cmnd_Alias DATE=/bin/date     %some_group ALL=(root) NOPASSWD: DATE      This did exactly what I needed as a member of the defined group.


title: Reference documentation for cgroups (control groups) settings

text: I'm looking for some reference documentation to explain what each of the settings are, for each control group. For example, there's `cpuset.cpus`, I think setting this to `0` means use all CPUs, setting it to `1` limits you to `1` core. And `cpuset.shares`, how is that configured exactly? Surely there's a reference doc that simply explains each of the settings somewhere right? Anyone have a link?


title: Debian: How to resolve Xserver failure

text: I keep finding similar posts online but I can't really use the solutions in my case. in my `/etc/bash.bashrc` file, I have the following code placed at the very bottom:               if [ -e /tmp/.X0-lock ]; then         rm /tmp/.X0-lock     fi          startx     cd /home/user1/Documents/ProgramFile     ./ myProgram.sh      This is to run my program automatically upon startup. I'm running Debian 6.0.7 squeeze. I want to run my program as root on startup. I executed the following command to disable the GUI:                update-rc.d -f gdm3 remove      I modified `/etc/inittab` to allow the root user to automatically login:               1:2345:respawn:/bin/login -f root tty1 </dev/tty1 > /dev/tty1 2>&1      when I boot up my box, I get the following error:               _XSERVTransSocketUNIXCreateListener: ...SocketCreateListener() failed     _XSERVTransMakeAllCOTSServerListeners: server already running          Fatal server error:     Cannot establish any listening sockets - Make sure an X server isn't already running          Please consult the The X.Org Foundation support      at http://wiki.x.org     for help.      Please also check the log file at "/var/log/Xorg.0.log" for additional information.          (WW) xf86CloseConsole: KDSETMODE failed: Bad file descriptor        (WW) xf86CloseConsole: VT_GETMODE failed: Bad file descriptor      Weird thing is this appears in a white box at the top left corner of my screen, it stays there fore a little while (~15 secs) and then I see my code execute and the screen changes to my application. Q: Can anyone explain to me what is going on here and what I can do to not get the error messages.


title: How can I migrate my Ubuntu installation from LVM2 to RAID5?

text: I stumbled upon this question, but I do not think this is a duplicate since I'm under the impression that the OP in this question is not running under a live session. I, on the other hand, have booted to an Ubuntu live USB drive for this operation. I have an Ubuntu installation where everything lives on an LVM2, save for a `/boot` partition. Thus far, I have done the following:   1. Created and mounted RAID5 array as md0   2. Mounted the current LVM, such that it's contents (along with `/boot`) can be accessed in `/media` I would like to do the following:   1. Move my entire installation from the LVM2 to the RAID5 array (I think `rsync -avx` is the correct way of doing this)   2. Make it so that I can boot from the RAID5 array (i.e. move `/boot`?) **My questions are as follows:**   1. Is `rsync -avx` the correct approach for moving my installation?   2. Do I need to copy `/boot` to the RAID5 array or to each of it's constituent discs? If so, how can I achieve this given that I am in a live Ubuntu environment?


title: How to debug the network issue in case of blocked database connections

text: I am trying to understand if my analysis of the below information is correct. For all the 3 scenarios listed here, `port 80`, `port 3306` and `port 22` are open in the server's firewall. Also, for all the 3 scenarios I am trying to connect from outside the school's network. **Scenario 1** I have a `php` code which I execute as,               http://server.edu/file.php      Inside, `file.php` I have a line as,               mysql -h server.edu -P 3306 -u user -p password -D database      For scenario 1, I am able to connect to the `mysql` database. **Scenario 2** I have a java program using which I am trying to establish a database connection from outside the school network. I get the `connection timed out` exception. The exception that I get is,               java net connectexception connection timed out connect      **Scenario 3** I run my php script as `php file.php` from outside school network and I get an error in the `mysql` line. So based on the above 3 scenarios, is it safe to believe that the school is blocking outside network connections? I tested the `ping server.edu` and it did not work. However, I believe `ping` uses `icmp` protocol which might be not allowed in the edge firewall. Is there some other test that I can perform on this?


title: netinstall media of CentOS 6.4 is broken?

text: I couldn't find a way to customize the partition schema during installation of CentOS 6.4, all these 3 options lead me directly to the "confirm disk change" screen. ![enter image description here](http://i.stack.imgur.com/P6qx1.png) Was it configured to be so? 'caue I saw a line says `The default layout is suitable for most users`. If not, how can I setup my own partitioning schema?


title: "stdin: is not a tty" mails for running scripts as cron jobs

text: I have several shell scripts (bash) which are started by cron. Every time a script is executed I get an email saying "stdin: is not a tty". Can someone please tell me how to fix this? All scripts run successfully but these mails are killing my email folder. I use Debian Wheezy. "/root/.bashrc" is empty. Cron entries are like:               /bin/bash --login /root/script.sh > /dev/null      Even this script produces the error message:               #!/bin/bash     ls      Content of .profile:               # ~/.profile: executed by Bourne-compatible login shells.          if [ "$BASH" ]; then       if [ -f ~/.bashrc ]; then         . ~/.bashrc       fi     fi          mesg n


title: Can someone provide an xargs example piping mysql query data into another command?

text: Can someone provide an example for the command `xargs`? I want to do a `mysql` query to return the ID field of a column then feed that result into `xargs` into another command say `mysql` query delete. How can this be done?


title: Crunchbang installation on netbook

text: I've recently installed crunchbang on my Compaq mini netbook, as the computer was not very powerful I chose crunchbang and was hoping to be able to use the computer mainly as a VPN server I could log in to from afar. The netbook does not have a Ethernet cable, but I was able, through a lot of searching online, to determine and download the correct driver onto a USB device, from which I am now trying to install the driver. I got the driver and some help from the Broadcom site How can I install the driver for the wireless network from the USB device?


title: How do i make a backup image of ChromeOS on an AcerC720?

text: I have tried using ImageBurner and the Recovery app in ChromeOS yet distro doesn't complete the operation and the image is never finished. I've tried USB drives by Transcend, HP and Jetflash and it doesn't seem to work on any? Could anybody help me on how i should proceed? Maybe using an SD card or a different app?


What is the faster way to launch any GUI program from the terminal without waiting for its completion and stdout / stderr logging? Now I'm using               "program_name >/dev/null 2>&1 &      but it's too long to type it every time. I'm new to the Linux world but I think that it's should resolved via small bash script, right?


title: Correct permissions for a .desktop file

text: Some file managers do not allow the execution of a `.desktop` file if it doesn't have the executable bit set, however in most cases I see such files as just `0644`, without the executable bit. When creating my own `.desktop` files for a software package, should I mark them as `0755` or `0644`? These files will be used to provide menu icons and desktop shortcuts, along with autostart entries.


title: Why does grep treat '[D]ebug' string differently?

text: I've created simple text file named "T" to test the unusual behavior of `grep`:                   1 Debug         2 debug         3 determined         4 Determined      Tried different syntax:                   $ grep De T             1 Debug             4 Determined         $ grep de T             2 debug             3 determined         $ grep Determined T             4 Determined         $ grep determined T             3 determined         $ grep Debug T             1 Debug         $ grep debug T             2 debug         $ grep [D]ebug T          # Why result is 2-nd line???             2 debug         $ grep [Dd]ebug T         # Why result is only one 2-nd line???             2 debug         $ grep [Dd]e T             1 Debug             2 debug             3 determined             4 Determined         $ grep [d]e T             2 debug             3 determined         $ grep [d]ebug T             2 debug         $ grep "[D]ebug" T             1 Debug         $ grep "[Dd]ebug" T             1 Debug             2 debug         $ grep [\D]ebug T         # Why result is 2-nd line???             2 debug         $ grep --version             grep (GNU grep) 2.16      As you can see, almost every grep call returns correct result, but `$ grep [D]ebug T`, `$ grep [Dd]ebug T`, `$ grep [\D]ebug T` return wrong results. Why is this happening?


title: Avoid trapping by ssh ProxyCommand

text: I have the following lines in my `.ssh/config`:               Host localhost     ProxyCommand none     Host n0*     ProxyCommand none          Host *     ProxyCommand corkscrew proxy.m.com 80 myserv 443 ~/.ssh/auth      i.e. for `localhost` and `n0*` ssh will not use the proxy, but for other hosts it will. I got trapped several times know when I wanted to connect to other **local machines** , but couldn't connect because the proxy was active. There was no exception for them in `~/.ssh/config`. Is there away to echo an information to the command line, when the proxy is used? e.g.               $ ssh otherpc       ---> using  ProxyCommand corkscrew proxy.m.com 80 myserv 443 ~/.ssh/auth     Password:       I know that `ssh -v` is listing this line (along with many others):               debug1: Executing proxy command: exec corkscrew proxy.m.com 80 myserv 443 ~/.ssh/auth                                                                                Is there less verbose way of displaying the proxy command used, helping me to avoid being trapped? Maybe a clever bash alias/function grepping `ssh -v`? _Warning:_ Don't write `ssh() { ssh -v | grep Proxy}`. I tried that too ... and accidently _fork bombed_ me :P


title: How to efficiently use Console2 with screen/tmux/byobu?

text: I'm using Console 2 and msysgit's bash to SSH into my Linux machines. There, I'm using screen (but considering tmux and/or byobu), but currently simply with one single-terminal session per Console2-tab. However, `screen` won't pass through the xterm escape sequence to change the tab title e.g. to the current path, which would be rather helpfull. So   * How to modify the xterm title from within screen?   * Should I use Console2 tabs or screen windows?   * Anything else to make life easier? (Yes, sorry, this is vague, consider the first bullet the actual question)