title: Emacs Message: save sent mails

text: How do you make Emacs Message (`C-x m`) save outgoing mails? Is there a standard way to do this? You could `C-x C-s` but this is inefficient and easy to forget, besides, you can't be 100% it is the mail actually sent: you might have done some last minute changes that you later forgot about. Could this (`save-buffer`) be invoked from a "send message" hook and be automated? (Like `text-mode-hook`.) If so, what hook? (How do you get the hooks of a mode?) `BCC` to yourself: not very elegant? `FCC`: seems to be best solution, still, must be automated, both invocation and a good file name generated.


title: How extended (4MB) and regular (4KB) paging coexist?

text: On x86 architecture, "Extended paging" allows page frames (physical memory) to be 4 MB instead of 4 KB. The book "Understanding the Linux Kernel, 3rd" at chapter 2 "Memory Addressing", sub-chapter "Paging in Linux", section "Kernel Page Tables", explains that for the final kernel Page Table when RAM size is less than 896 MB: > [...]the kernel can address the RAM by making use of large pages (see the > section "Extended Paging" earlier in this chapter). However, in the section "Extended Paging" (sub-chapter "Paging in Hardware"), it is written : > Extended paging coexists with regular paging. I don't actually get how extended and regular paging coexist. Can please someone explain those questions:   * In which cases the kernel uses 4 MB pages? or 4 KB pages?   * Which page frame size will be used for kmalloc operations? for vmalloc?   * If we assume that the initial code & data (kernel's segments, provisional Page Tables, and 128 KB for dynamic data) fit in the first 8 MB of RAM (as the example given by the book), what if the real amount of code & data is 5MB only: will the kernel waste 8 - 5 = 3 MB?


title: GNOME keyring manager and gnupg

text: I get this               gpg: WARNING: The GNOME keyring manager hijacked the GnuPG agent.     gpg: WARNING: GnuPG will not work proberly - please configure that tool to not interfere with the GnuPG system!      when I use gnupg-agent with mutt. But the warning doesn't give me clue how to resolve the issue, nor could I find the info from GNOME documentation.


title: end of line in linux and mac

text: I am analyzing a text file looking for a path that is written after a line that starts with "output". The line is something like               output xyz/mypath/      and I want to extract `xyz/mypath` **without** the final slash. On my Mac OS X (BSD) and Linux I get different behaviors when I get the path with this `basepath=cat $basefile | grep -e ^output\ | cut -d" " -f2 | rev | sed 's@/$@@' | rev` The tricky part seems to be `sed 's@/$@@` which on Mac works, while it does not on Linux. Vice-versa if I do `sed 's@/@@` it works on linux not on Mac (BSD). The trick seems to be related to the end-of-line char $ which is managed differently (maybe at the level of cat. Any suggestion to work around this in a way that both Mac and Linux console will do the job?


title: printing special characters in awk output

text: I have a large file that contains lot MQ messages with RFH2 header. Each message in the file is separated by a blank line. Now I need to split this large file into small files each containing single message with RFH2 header. I tried with the below awk command `awk '{RS=""} {print $0}' inputfile` This prints the first line without the control characters which is not useful. The first MQ RFH header line starts like `RFH ^B^C^X^A^Q^C3MQSTR ^D¸` followed by message data. The awk output only prints the text `RFH`. If the input file has 50 messages after running this command I get 50 files having only the text `RFH` in them. I am expecting 50 files with RFH2 header and data. I could not give you the real file input because it has sensitive data. The file starts with               RFH ^B^C^X^A^Q^C3MQSTR ^D¸X<jms>     .........some text of many lines.....          RFH ^B^C^X^A^Q^C3MQSTR ^D¸X<jms>     ........some text of many lines.....          RFH ^B^C^X^A^Q^C3MQSTR ^D¸X<jms>     ...      And the output files should have               RFH ^B^C^X^A^Q^C3MQSTR ^D¸X<jms>     .........some text of many lines


title: upstart writing to syslog in a simple way

text: I have an upstart script that uses               pre-start script       exec >/dev/kmsg 2>&1       echo starting program       # run my program here       npm install       node app.js     end script      to redirect output of a program to `/etc/var/syslog`. It seems to be broken since writing to `/dev/kmsg` is not possible anymore in Ubuntu 14.04 LTS (I have another machine with Ubuntu 12.04 LTS that it is working fine) Anyone can think of an alternate way ?


title: Solaris - calling app from java - no such file or library

text: I call ffmpeg from a java application on Solaris. If I run ffmpeg with the same parameters from command line, then it works fine, but calling it from Java app results the following error message:               stderr ---     ld.so.1: ffmpeg: fatal: libiconv.so.2: open failed: No such file or directory      I see this               root@xxxx# echo $LD_LIBRARY_PATH     /usr/openwin/lib:/lib:/usr/lib:/usr/local/lib      The ffmpeg is not installed, just compiled. Do you know what might be the problem here? Thanks Zoltan


title: Is arp periodically called to check connectivity?

text: Do most of linux implementations periodically make arp requests to check connectivity? I am trying to migrate an ubuntu virtual machine and, after migration, it just loses network connectivity.


title: How to force 'yum search' to use local metadata/cache?

text: A lot of times when I run `yum search`, it tends first to download the metadata from a repository. How do I force it to only search the local cache? I prefer quick results to accurate data in this case, and am on a slow line.


title: Is there a way to completely get rid of notifications in KDE 4.6?

text: I don't like, don't care about, don't want notifications from my window manager. Ever. Example: Since I manually removed the `virtuoso-t` package, my computer doesn't spend ages trying to index its own files. I consider that a good thing. When I start KDE, I get a notification that the Nepomuk RDF service cannot work properly without `virtuoso`. So I have to waste a click closing that window. I also don't update my packages just because there happen to be new versions of things out. I generally wait a while. When I use `apt-get`, which is a lot, I get a notification that there are a number of new 'system updates'. Every single time. Like _punishment._ I'm not interested in using LXDE or XFCE. I prefer pure KDE in a lot of ways. But if I could suppress all of KDE's messages, more in line with the 'no news is good news' user experience, that would really be superb. _I'd have so many fewer windows to close at various intervals, after all._


title: How to display my data (molecules)?

text: In my code I generate a .dat file which is of the format: > x \t y \t z \t charge \t type \t ID There are about 3000 lines in the file and I want to display sphere (of radius 1 in my units). I tried to use `paraview`, `pymol` and `rasmol`. Paraview doesn't understand my file format. With pymol and rasmol I couldn't understand how they loaded my data. Do any of you know how to load data which is not in pdb format into pymol or rasmol? Also, I want to color the beads according to the last 3 properties is there any other way? I should note that I need the ability to browse through the 3d picture I get. My question might not be clear so please ask me for any clarification I might give.


title: Make screenshots of Ti-calculator screen

text: I want to connect a TI-84 Plus Calculator to my PC and take screenshots of the calculator display. Under windows this is possible using the TI-connect software. However is there also a way to do this under linux?


title: How to boot from iso with Grub2/Burg boot loader

text: I'm using Ubuntu as my primary OS and alternative is Windows 7 for gaming, and another stuffs. I want to have menu to boot some live CD ISO. Is there anyway to make menu entry in Grub2/Burg to boot ISO file like the CD way? I see there are some ways to make it possible but almost method need specified boot arguments (kernel parameters). But I have mixed kind of Live OS wan to boot up using boot loader included: Linux, Unix, DOS (for recovery purpose)... I'm looking for more generic way to make it easy to discover and add to the menu config file.


title: Manipulating and saving multiple files

text: I have ~2k files that I want to extract 12 of 26 columns and save the extracted information into a new file. I have been doing this for individual files using               cat "oldfile.csv" | grep -v "=" | cut -f 1-4,9,14,15,19,21,22,24,26 > newfile.csv      There must be a way to do all files with one Unix series of commands. Any help is greatly appreciated


title: Why are underscores not allowed in usernames in some distros (Debian for example)

text: So why has the underscore been considered a bad character for user names in Debian (and possibly other distributions) while it has been removed from `adduser`'s NAME_REGEX in Ubuntu?


title: btrfs, infamous ENOSPC error while doing a backup from a snapshot

text: My system is Fedora 19 x86_64 w/3.10.7 kernel. I am trying to use a btrfs snapshot for backing up my `/`, like this:               #!/bin/bash     btrfs subvolume snapshot / /snap/     tar -cvf - /snap 2>/dev/null | /opt/bup/bin/bup split -n nb -vv     btrfs subvolume delete /snap      Unfortunately the system runs out of free space somewhere at the middle of this process. `btrfs filesystem df /` reports there is some free space actually:               [root@cellar ~]# btrfs filesystem df /     Data: total=107.21GB, used=75.06GB     System, DUP: total=8.00MB, used=20.00KB     System: total=4.00MB, used=0.00     Metadata, DUP: total=3.50GB, used=3.00GB     Metadata: total=8.00MB, used=0.00      but I can't neither create nor delete a single file. This is 100% reproducible on every script run. I am usually able to recover from this situation after about 30 mins of random tries to delete anything unimportant. It looks like the root of problem is metadata space shortage. When there is no snapshot my system uses about 2.39-2.40GB of metadata space. This looks like a bug to me. Why does a snapshot need 0.6GB of the metadata space when there are no heavy writes at this time at all? Why is btrfs unable to use remaining 0.5GB of the metadata space? I tried to use `btrfs balance` but it did not relocate anything so I guessed the FS was perfectly balanced already. Is it possible to reserve more metadata space somehow? (probably I need to reformat the whole partition but I was unable to find anything related to metadata space size in `mkfs.btrfs` manual). I guess I can set a larger nodesize using `-n` option but I'm not sure if it can help.


title: How to automatically apply changes in a folder to another?

text: Running Ubuntu 12.04, I work software _"production"_ on certain folders and then I usually copy files I make up to another paths where I do the _"deployment"_. For example, sometimes I produce some files in `/home/user/develop` and I want them to go to `/media/ntfs` too. Also, for example I work on `/home/user/develop` but I want them to go to `/var/www` if I'm testing web stuffs. So, any last generated folders, or any given files list should be copied. I thought first this was about symbolic links but I think it isn't what's the best way to do this, scripting?


title: Virtual address of Global variables in Kernel code

text: If my understanding is not wrong, every process has a Kernel Address space associated with it (which is typically 1GB). As far as local variables are concerned, they are assigned on the kernel stack and so their virtual address is according to the address of the kernel stack. However, if there are global variables in the kernel code, what will be the virtual address of these variables? When and who will assign this address? If it is the compiler, how does the compiler know that some part of code is kernel code? Sorry for asking such a naive question, but I'm really confused here.


title: How can I ensure only the root user have the right to halt/reboot the system?

text: CentOS Linux by default allows all users to have permission to "halt" & "reboot" the system by using the commands `halt` and `reboot`. How can I configure my system so that only the root user has the right to `halt`/`reboot` the system?


title: Converting .docx files to plain text and preserving line breaks to maintain line number references to source document: howto & implications?

text: I'm exporting MS _Word_ content to plain text for use with text&file utilities. I have a constraint where the _line numbering_ feature has been enabled in the MS software, and any reference to line numbers in the final output **must** match that numbering. So enter "numbering lines": ![enter image description here](http://i.stack.imgur.com/ERFob.jpg) ( _Poe, E.A._ ) Obviously for _Word_ , that sort of numbering doesn't break lines at _newline_ , it breaks "lines" after the _right margin_ (or something). A script like `docx2txt`, doesn't account for this by default it seems and breaks lines at newline. So if I use `grep -n` with numbering, the lines won't match the source line numbers feature, as illustrated above. It's not exactly clear from the documentation how I would need to edit the Perl script to convert the files the way I need to in this case:               our $config_newLine = "\n"; # Alternative is "\r\n".     our $config_lineWidth = 80; # Line width, used for short line justification.      I tried substituting `\n` for `\r\n` but that doesn't seem to work for me. So I resorted to exporting the documents directly from _Word_ with the following settings(save as _plain text_ , on v.2013,64pc):   * Unicode(UTF-8)   * Insert line breaks + end lines with (CR/LF)   * Allow character substitution And now indeed when I use the `.txt` files there is a perfect match between line numbers in the source numbering feature and the `grep -n` output. * * *   * Is there any specific configuration/process I should know about `docx2txt` or a similar command line utility which would have allowed me to convert my _.docx_ files to plain text while preserving line breaks, without resorting to _Word_ like I did?   * What are the _best practices_ , if any, for exporting MS _Word_ documents (which may contain accented characters) to plain text for use with file/text utilities, with respect to line breaks and formatting; and are there any negative implications with the settings I chose for exporting i.e. inserting CR/LF? * * * _Sample_ As suggested I provide a sample. In this rar archive, I bundled a _.docx_ file with simple paragraphs, and its exported _.txt_ file using Word with the aforementioned options. The latter can be compared with a default run of `docx2txt` on the source file.


title: Errors building XScreensaver for X11 (and dependencies) on Mac

text: I'm building XScreensaver (the X11 version) on Mac OSX and I get the following errors while building/compiling it and its deps. ### XScreensaver               terences-imac:xscreensaver-5.21 MAU$ make     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include alpha.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from alpha.c:16:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include colors.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from colors.c:16:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include fade.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from fade.c:12:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include grabscreen.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from grabscreen.c:33:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include grabclient.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from grabclient.c:21:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include hsv.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from hsv.c:16:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include overlay.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from overlay.c:58:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include resources.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from resources.c:13:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include spline.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from spline.c:27:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include usleep.c     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include visual.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from visual.c:20:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include visual-gl.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from visual-gl.c:23:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include xmu.c     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include logo.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from logo.c:22:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include yarandom.c     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include erase.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from erase.c:18:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include xshm.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from xshm.c:33:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include xdbe.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from xdbe.c:18:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include colorbars.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from colorbars.c:16:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include minixpm.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from minixpm.c:34:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     gcc -pedantic -Wall -Wstrict-prototypes -Wnested-externs -Wmissing-prototypes -Wno-overlength-strings -Wdeclaration-after-statement -no-cpp-precomp -c -I. -I..  -DHAVE_CONFIG_H -g -O2 -I/usr/X11/include textclient.c     In file included from /usr/X11/include/X11/Xlib.h:47,                      from utils.h:24,                      from textclient.c:21:     /usr/X11/include/X11/Xfuncproto.h:136:24: warning: ISO C does not permit named variadic macros     /bin/sh ./../utils/ad2c XScreenSaver.ad > XScreenSaver_ad.h     sed: RE error: illegal byte sequence     make[1]: *** [XScreenSaver_ad.h] Error 1     make: *** [default] Error 5      ### GDK Pixbuf:               terences-imac:gdk-pixbuf-2.29.0 MAU$ ./configure     checking for a BSD-compatible install... /usr/bin/install -c     checking whether build environment is sane... yes     checking for a thread-safe mkdir -p... ./install-sh -c -d     checking for gawk... no     checking for mawk... no     checking for nawk... no     checking for awk... awk     checking whether make sets $(MAKE)... yes     checking whether make supports nested variables... yes     checking how to create a ustar tar archive... gnutar     checking whether to enable maintainer-specific portions of Makefiles... yes     checking whether make supports nested variables... (cached) yes     checking for gcc... gcc     checking whether the C compiler works... yes     checking for C compiler default output file name... a.out     checking for suffix of executables...      checking whether we are cross compiling... no     checking for suffix of object files... o     checking whether we are using the GNU C compiler... yes     checking whether gcc accepts -g... yes     checking for gcc option to accept ISO C89... none needed     checking for style of include used by make... GNU     checking dependency style of gcc... gcc3     checking whether gcc and cc understand -c and -o together... yes     checking for gcc option to accept ISO C99... -std=gnu99     checking for gcc -std=gnu99 option to accept ISO Standard C... (cached) -std=gnu99     checking whether make sets $(MAKE)... (cached) yes     checking for pkg-config... /usr/bin/pkg-config     checking pkg-config is at least version 0.9.0... yes     checking build system type... x86_64-apple-darwin12.3.0     checking host system type... x86_64-apple-darwin12.3.0     checking for native Win32... no     checking how to print strings... printf     checking for a sed that does not truncate output... /usr/bin/sed     checking for grep that handles long lines and -e... /usr/bin/grep     checking for egrep... /usr/bin/grep -E     checking for fgrep... /usr/bin/grep -F     checking for ld used by gcc -std=gnu99... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld     checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no     checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm     checking the name lister (/usr/bin/nm) interface... BSD nm     checking whether ln -s works... yes     checking the maximum length of command line arguments... 196608     checking whether the shell understands some XSI constructs... yes     checking whether the shell understands "+="... yes     checking how to convert x86_64-apple-darwin12.3.0 file names to x86_64-apple-darwin12.3.0 format... func_convert_file_noop     checking how to convert x86_64-apple-darwin12.3.0 file names to toolchain format... func_convert_file_noop     checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r     checking for objdump... no     checking how to recognize dependent libraries... pass_all     checking for dlltool... no     checking how to associate runtime and link libraries... printf %s\n     checking for ar... ar     checking for archiver @FILE support... no     checking for strip... strip     checking for ranlib... ranlib     checking command to parse /usr/bin/nm output from gcc -std=gnu99 object... ok     checking for sysroot... no     checking for mt... no     checking if : is a manifest tool... no     checking for dsymutil... dsymutil     checking for nmedit... nmedit     checking for lipo... lipo     checking for otool... otool     checking for otool64... no     checking for -single_module linker flag... yes     checking for -exported_symbols_list linker flag... yes     checking for -force_load linker flag... yes     checking how to run the C preprocessor... gcc -std=gnu99 -E     checking for ANSI C header files... yes     checking for sys/types.h... yes     checking for sys/stat.h... yes     checking for stdlib.h... yes     checking for string.h... yes     checking for memory.h... yes     checking for strings.h... yes     checking for inttypes.h... yes     checking for stdint.h... yes     checking for unistd.h... yes     checking for dlfcn.h... yes     checking for objdir... .libs     checking if gcc -std=gnu99 supports -fno-rtti -fno-exceptions... no     checking for gcc -std=gnu99 option to produce PIC... -fno-common -DPIC     checking if gcc -std=gnu99 PIC flag -fno-common -DPIC works... yes     checking if gcc -std=gnu99 static flag -static works... no     checking if gcc -std=gnu99 supports -c -o file.o... yes     checking if gcc -std=gnu99 supports -c -o file.o... (cached) yes     checking whether the gcc -std=gnu99 linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes     checking dynamic linker characteristics... darwin12.3.0 dyld     checking how to hardcode library paths into programs... immediate     checking whether stripping libraries is possible... yes     checking if libtool supports shared libraries... yes     checking whether to build shared libraries... yes     checking whether to build static libraries... no     configure: creating ./config.lt     config.lt: creating libtool     checking for special C compiler options needed for large files... no     checking for _FILE_OFFSET_BITS value needed for large files... no     checking dependency style of gcc -std=gnu99... gcc3     checking for some Win32 platform... no     checking whether build environment is sane... yes     checking for BASE_DEPENDENCIES... no     configure: error: Package requirements (glib-2.0 >= 2.37.0) were not met:          Requested 'glib-2.0 >= 2.37.0' but version of GLib is 2.30.3          Consider adjusting the PKG_CONFIG_PATH environment variable if you     installed software in a non-standard prefix.          Alternatively, you may set the environment variables BASE_DEPENDENCIES_CFLAGS     and BASE_DEPENDENCIES_LIBS to avoid the need to call pkg-config.     See the pkg-config man page for more details.      ### GLIB               make  all-recursive     Making all in .     Making all in m4macros     make[2]: Nothing to be done for `all'.     Making all in glib       GEN      glibconfig-stamp     config.status: executing glib/glibconfig.h commands     config.status: glib/glibconfig.h is unchanged     make  all-recursive     Making all in libcharset     make[4]: Nothing to be done for `all'.     Making all in pcre     make[4]: Nothing to be done for `all'.     Making all in update-pcre     make[4]: Nothing to be done for `all'.     Making all in .     echo glib-unix.h glib-object.h glib.h galloca.h garray.h gasyncqueue.h gatomic.h gbacktrace.h gbase64.h gbitlock.h gbookmarkfile.h gbytes.h gcharset.h gchecksum.h gconvert.h gdataset.h gdate.h gdatetime.h gdir.h genviron.h gerror.h gfileutils.h ggettext.h ghash.h ghmac.h ghook.h ghostutils.h gi18n.h gi18n-lib.h giochannel.h gkeyfile.h glist.h gmacros.h gmain.h gmappedfile.h gmarkup.h gmem.h gmessages.h gnode.h goption.h gpattern.h gpoll.h gprimes.h gqsort.h gquark.h gqueue.h grand.h gregex.h gscanner.h gsequence.h gshell.h gslice.h gslist.h gspawn.h gstdio.h gstrfuncs.h gtestutils.h gstring.h gstringchunk.h gthread.h gthreadpool.h gtimer.h gtimezone.h gtrashstack.h gtree.h gtypes.h gunicode.h gurifuncs.h gutils.h gvarianttype.h gvariant.h gversion.h gversionmacros.h gwin32.h gprintf.h > glib-public-headers.txt.tmp && mv glib-public-headers.txt.tmp glib-public-headers.txt     Making all in tests     make[4]: Nothing to be done for `all'.     Making all in gmodule     make  all-am       CC       libgmodule_2_0_la-gmodule.lo       CCLD     libgmodule-2.0.la     Making all in gthread     make[2]: Nothing to be done for `all'.     Making all in gobject     make  all-recursive     Making all in .       GEN      gobject-public-headers.txt     Making all in tests     make  all-am     make[5]: Nothing to be done for `all-am'.     Making all in gio       GEN      gioenumtypes.h       GEN      gioenumtypes.c     make  all-recursive     Making all in gdbus-2.0/codegen       GEN      gdbus-codegen     Making all in xdgmime     make[4]: Nothing to be done for `all'.     Making all in kqueue       CC       libkqueue_la-gkqueuedirectorymonitor.lo       CC       libkqueue_la-kqueue-helper.lo       CC       libkqueue_la-kqueue-exclusions.lo       CCLD     libkqueue.la     Making all in .       CC       libgio_2_0_la-gasynchelper.lo       CC       libgio_2_0_la-gconverterinputstream.lo       CC       libgio_2_0_la-gconverteroutputstream.lo       CC       libgio_2_0_la-gcredentials.lo     gcredentials.c:88:2: warning: #warning Please add GCredentials support for your OS       CC       libgio_2_0_la-gdatainputstream.lo       CC       libgio_2_0_la-gdataoutputstream.lo       CC       libgio_2_0_la-gdummyfile.lo       CC       libgio_2_0_la-gemblem.lo       CC       libgio_2_0_la-gfile.lo       CC       libgio_2_0_la-gfileenumerator.lo       CC       libgio_2_0_la-gfilemonitor.lo       CC       libgio_2_0_la-gicon.lo       CC       libgio_2_0_la-ginetaddress.lo       CC       libgio_2_0_la-ginetaddressmask.lo       CC       libgio_2_0_la-ginetsocketaddress.lo       CC       libgio_2_0_la-ginputstream.lo       CC       libgio_2_0_la-giomodule.lo     giomodule.c: In function '_g_io_modules_ensure_extension_points_registered':     giomodule.c:960: warning: 'g_desktop_app_info_lookup_get_type' is deprecated (declared at gdesktopappinfo.h:124)       CC       libgio_2_0_la-gmemoryinputstream.lo       CC       libgio_2_0_la-gmemoryoutputstream.lo       CC       libgio_2_0_la-gmountoperation.lo       CC       libgio_2_0_la-gnetworkaddress.lo       CC       libgio_2_0_la-gnetworking.lo       CC       libgio_2_0_la-gnetworkmonitor.lo       CC       libgio_2_0_la-gnetworkservice.lo       CC       libgio_2_0_la-goutputstream.lo       CC       libgio_2_0_la-gpollableinputstream.lo       CC       libgio_2_0_la-gpollableoutputstream.lo       CC       libgio_2_0_la-gpollableutils.lo       CC       libgio_2_0_la-gproxyaddressenumerator.lo       CC       libgio_2_0_la-gresolver.lo       CC       libgio_2_0_la-gsocket.lo       CC       libgio_2_0_la-gsocketaddress.lo       CC       libgio_2_0_la-gsocketclient.lo       CC       libgio_2_0_la-gsocketconnection.lo       CC       libgio_2_0_la-gsocketcontrolmessage.lo       CC       libgio_2_0_la-gsocketinputstream.lo       CC       libgio_2_0_la-gsocketoutputstream.lo       CC       libgio_2_0_la-gsocketservice.lo       CC       libgio_2_0_la-gsimpleproxyresolver.lo       CC       libgio_2_0_la-gthreadedresolver.lo       CC       libgio_2_0_la-gtlsbackend.lo       CC       libgio_2_0_la-gtlsclientconnection.lo       CC       libgio_2_0_la-gtlsconnection.lo       CC       libgio_2_0_la-gtlsinteraction.lo       CC       libgio_2_0_la-gtlspassword.lo       CC       libgio_2_0_la-gtlsserverconnection.lo       CC       libgio_2_0_la-gzlibcompressor.lo       CC       libgio_2_0_la-gzlibdecompressor.lo       CC       libgio_2_0_la-gioenumtypes.lo       CC       libgio_2_0_la-gdesktopappinfo.lo       CC       libgio_2_0_la-gfiledescriptorbased.lo       CC       libgio_2_0_la-gunixconnection.lo       CC       libgio_2_0_la-gunixcredentialsmessage.lo     gunixcredentialsmessage.c: In function 'g_unix_credentials_message_serialize':     gunixcredentialsmessage.c:189: warning: unused variable 'message'       CC       libgio_2_0_la-gunixfdlist.lo       CC       libgio_2_0_la-gunixfdmessage.lo       CC       libgio_2_0_la-gunixmount.lo       CC       libgio_2_0_la-gunixmounts.lo       CC       libgio_2_0_la-gunixsocketaddress.lo       CC       libgio_2_0_la-gunixvolume.lo       CC       libgio_2_0_la-gunixvolumemonitor.lo       CC       libgio_2_0_la-gunixinputstream.lo       CC       libgio_2_0_la-gunixoutputstream.lo       CC       libgio_2_0_la-gapplication.lo       CC       libgio_2_0_la-gapplicationcommandline.lo       CC       libgio_2_0_la-gapplicationimpl-dbus.lo       CC       libgio_2_0_la-gdbusaddress.lo       CC       libgio_2_0_la-gdbusauthobserver.lo       CC       libgio_2_0_la-gdbusauth.lo       CC       libgio_2_0_la-gdbusauthmechanism.lo       CC       libgio_2_0_la-gdbusauthmechanismanon.lo       CC       libgio_2_0_la-gdbusauthmechanismexternal.lo       CC       libgio_2_0_la-gdbusauthmechanismsha1.lo       CC       libgio_2_0_la-gdbuserror.lo       CC       libgio_2_0_la-gdbusconnection.lo       CC       libgio_2_0_la-gdbusmessage.lo       CC       libgio_2_0_la-gdbusproxy.lo       CC       libgio_2_0_la-gdbusprivate.lo       CC       libgio_2_0_la-gdbusmethodinvocation.lo       CC       libgio_2_0_la-gdbusserver.lo       CC       libgio_2_0_la-gdbusinterfaceskeleton.lo       CC       libgio_2_0_la-gdbusobjectmanagerclient.lo       CC       libgio_2_0_la-gtestdbus.lo       CC       libgio_2_0_la-glocaldirectorymonitor.lo       CC       libgio_2_0_la-glocalfile.lo       CC       libgio_2_0_la-glocalfileinputstream.lo       CC       libgio_2_0_la-glocalfilemonitor.lo       CC       libgio_2_0_la-glocalfileoutputstream.lo       CC       libgio_2_0_la-glocalfileiostream.lo       CC       libgio_2_0_la-glocalvfs.lo       CCLD     libgio-2.0.la     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib       CCLD     gio-querymodules     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib       CC       gvdb-builder.o       CC       glib-compile-schemas.o       CCLD     glib-compile-schemas       CC       glib-compile-resources.o       CCLD     glib-compile-resources     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib       CC       gsettings-tool.o       CCLD     gsettings     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib       CC       gdbus-tool.o       CCLD     gdbus     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib       CC       gresource-gresource-tool.o       CCLD     gresource     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libffi.dylib     ld: warning: ignoring file /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /Library/Frameworks/Mono.framework/Versions/2.10.11/lib/libintl.dylib       GEN      gio-public-headers.txt     Making all in tests     dyld: Symbol not found: _ffi_type_double       Referenced from: /Users/MAU/Downloads/glib-2.37.1/gobject/.libs/libgobject-2.0.0.dylib       Expected in: flat namespace      in /Users/MAU/Downloads/glib-2.37.1/gobject/.libs/libgobject-2.0.0.dylib     dyld: Symbol not found: _ffi_type_double       Referenced from: /Users/MAU/Downloads/glib-2.37.1/gobject/.libs/libgobject-2.0.0.dylib       Expected in: flat namespace      in /Users/MAU/Downloads/glib-2.37.1/gobject/.libs/libgobject-2.0.0.dylib     dyld: Symbol not found: _ffi_type_double       Referenced from: /Users/MAU/Downloads/glib-2.37.1/gobject/.libs/libgobject-2.0.0.dylib       Expected in: flat namespace      in /Users/MAU/Downloads/glib-2.37.1/gobject/.libs/libgobject-2.0.0.dylib     dyld: Symbol not found: _ffi_type_double       Referenced from: /Users/MAU/Downloads/glib-2.37.1/gobject/.libs/libgobject-2.0.0.dylib       Expected in: flat namespace      in /Users/MAU/Downloads/glib-2.37.1/gobject/.libs/libgobject-2.0.0.dylib       GEN      gdbus-test-codegen-generated.c       GEN      test_resources.c     dyld: Symbol not found: _ffi_type_double       Referenced from: /Users/MAU/Downloads/glib-2.37.1/gobject/.libs/libgobject-2.0.0.dylib       Expected in: flat namespace      in /Users/MAU/Downloads/glib-2.37.1/gobject/.libs/libgobject-2.0.0.dylib     /bin/sh: line 1: 83097 Trace/BPT trap: 5       ../../gio/glib-compile-resources --target=test_resources.c --sourcedir=. --generate-source --c-name _g_test1 test2.gresource.xml     make[4]: *** [test_resources.c] Error 133     make[3]: *** [all-recursive] Error 1     make[2]: *** [all] Error 2     make[1]: *** [all-recursive] Error 1     make: *** [all] Error 2      How can I fix it?


title: xorg.conf.d not loaded when starting X while docked

text: Recently installed archlinux on a Lenovo T530 Thinkpad and using it with a Mini dock Series 3. Docking and undocking works just like it should, using acpid to execute scripts turning screens on and off, but if I start X while the computer is docked it appears to not load the `xorg.conf.d` files that I have, such as setting the proper keymap. It also makes both the built in and external screen use an unmotivated low resolution. What could be the problem? Is there any known solutions to this? (Connected to the dock is a bluetooth mouse, a bluetooth keyboard and a DVI- display. The linux distribution installed is Arch.)


title: SSH: I have a *.pem private key. How to create a SSH connection using it?

text: I tried to use putty also. I select this `pem` key there and got this:               Unable to use key file "key.pem" (not a private key).      I read that it is possible to convert a `pem` to a `pub` key. I did it like there:   1. Convert pem key to ssh-rsa format   2. How can I convert a PEM key into a RSA key pair? But I got the same error when trying to connect.


title: How can I easily determine which pseudo-terminal device a terminal emulator has been assigned?

text: I'm writing a little curses program and I want to redirect `stderr` to another terminal. However, the only way of determining the correct `/dev/pts/X` device to redirect to that I know of is to echo text to them one at a time until it shows up where I want. Is there a command which will give me what I'm looking for?


title: Opening a usable xterm window through bash script

text: I often have projects for which I need multiple terminal windows open at different locations, and setting up my workspace each time I want to work on this project takes a long time, so I'd like to be able to automate it with a script. I've only been able to get as far as this:               xterm -hold -e "cd SOMEDIRECTORY && DO STUFF"      But the problem with that is that it just executes the command and doesn't allow me to do anything else in that window. I'd like to be able to have the window open up to a certain directory, execute some commands there, and then allow me to do my own thing in that directory. How can I achieve this?


title: mpg321 doesn't autoplay songs

text: I'm using mpg321 on OSX and I just try to play my songs with mpg321 *.mp3. It plays fine but doesn't play the next song automatically. I have to press some key for it to play which is kind of annoying. How can I make it so it plays automatically?


title: Enable Bash-Completion to expand Superuser executables to full path

text: I'm running OpenSUSE 12.3 (and have seen the behavior since 11), and have found that I can't call Superuser programs (e.g. shutdown, reboot) without using the full path. For me, many of these executables live in `/sbin`, so instead of using `sudo reboot`, I have to call `sudo /sbin/reboot`. Thankfully, when using **sudo** OpenSUSE's shell ( **bash** ) will expand these paths when I press the `Tab` key, so `sudo rebo[Tab]` will result in `sudo /sbin/reboot`. OpenSUSE provides a package by the name of **bash-completion** which expands the auto-complete functionality of **bash** to include all sorts of other contexts (e.g. **gsettings** ). Unfortunately, by default, this package does not expand the Superuser executables to their full paths, but just expands the executable name, so `sudo rebo[Tab]` will result in `sudo reboot`, which will lead to a `sudo: reboot: command not found` error. How do I install/run **bash-completion** yet ensure the autocomplete for Superuser executables expands to the full path?


title: sed - find string and append

text: Suppose you have the following text file               127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4     ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6     10.0.5.213 c04c0.ac     10.0.5.213 c04c1.ac      10.0.5.213 c04c2.ac      10.0.5.213 c04c3.ac     10.0.5.213 c04c4.ac     10.0.5.213 c04c5.ac     10.0.5.213 c04c6.ac     10.0.5.213 c04c7.ac     10.0.5.213 c04c8.ac     ....      How would you turn it into this?               127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4     ::1         localhost localhost.localdomain localhost6 localhost6.localdomain6     10.0.5.213 c04c0.ac c04c0     10.0.5.213 c04c1.ac c04c1     10.0.5.213 c04c2.ac c04c2     10.0.5.213 c04c3.ac c04c3      10.0.5.213 c04c4.ac c04c4     10.0.5.213 c04c5.ac c04c5     10.0.5.213 c04c6.ac c04c6     10.0.5.213 c04c7.ac c04c7     10.0.5.213 c04c8.ac c04c8     ....      I've managed to strip '.ac' from the hostnames. However I'm not sure why 'localhost' was not striped out by the regex. How can I modify the regular expression to only collect c04cx and append it to the end of the line?               cat /etc/hosts | awk '{print $2}'| sed -r 's/(c04c)([0-9]+)(.*)/\1\2/'          localhost     localhost     c04c0     c04c1     c04c2     c04c3     c04c4     c04c5     c04c6     c04c7     c04c8


title: set gnome terminal background/text color from bash script

text: I would like to setup my gnome terminal's background(`#002b36`) and foreground color in ubuntu 13, using bash script. I tried `gconftool` but couldn't succeed.               GCONFTOOL-2(1)                  User Commands                                                    GCONFTOOL-2(1)          NAME            gconftool-2 - GNOME configuration tool      My `gnome terminal` version is               $ gnome-terminal --version     GNOME Terminal 3.6.1      ![enter image description here](http://i.stack.imgur.com/kfpAA.png) ## Currently I'm using ubuntu terminal preferences UI to achieve this. ![enter image description here](http://i.stack.imgur.com/bw0y7.png)


title: date, get current 15 minute interval

text: Is there any way I can get the current 15 minute interval using the date command or similar ? e.g. something like date `%Y.%m.%d %H:%M` will give me 2011.02.22 10:19 , I need something that yields 2011.02.22 10:15 in the time span from 10:15 to 10:29.


title: How to fix a Live-OS image that says Invalid

text: I was running Fedora-20 off a USB stick with persistent storage till I stupidly ignored a warning & filled up the persistent image. Now boot fails, because it cannot mount the root filesystem & it falls to a Dracut emergency shell. With a bit more debug I find that 'dmsetup status' says:               live-rw ......snapshot Invalid      How do I fix this? Ideas? Online I found another thread here: that describes this problem but I cannot find both files it mentions i.e. /path/to/overlay may be /mnt/live/LiveOS/overlay-devicename-discUUID or /media/devicename/LiveOS/overlay-devicename-discUUID for an attached device. So what file do I try doing this on:               # echo $'\x01' | dd of=/path/to/overlay-file bs=1 count=1 seek=4 conv=notrunc      Edit: A far more technical description of the problem is on this thread


title: Variable substitution into a sed script

text: After running this code               #!/bin/bash     rm -f myfile myfile-individual     echo "Greetings, foobar!" > myfile     MYSTRING="Jack"     cat myfile | sed 's:foobar:$MYSTRING:' > myfile-individual      we end up with               Greetings, $MYSTRING!      in myfile-individual. What should be the (sed/bash) script for the output to be instead               Greetings, Jack!


title: Does restarting of Display Manager (e.g lightdm) restart X server as well?

text: If I restart the Display Manager, e.g `lightdm`, will X be restarted as well ?


title: CentOS: Sharing WLAN for internet access

text: I have installed CentOS 6.2 on HP Proliant server. I want to share my USB wireless internet (Tata photon +). I am able to start internet on my server, but when I enable my LAN, I don't have internet access anymore. Also I am not able to share my server's internet to other Windows 7 computers. How can I share my connection?


title: chkconfig format not accepted in rhel

text: I'm currently working on "Red Hat Enterprise Linux Server release 5.10 (Tikanga)" and i am having issues while adding a script to the startup using chkconfig. Below is the Header Code of "MyScript" file: MyScript (present in /etc/init.d)                 #!/bin/bash     # MyScript      MyCustom Deamon     # Author:       MySelf     # chkconfig:    35 97 03     # Description:  This is a daemon      When i remove the MyScript, Author - it works. However, when i remove Description comment chkconfig refuses to accept it, throwing the below error.               [root@uk1salx00012 init.d]# chkconfig --add MyScript     service MyScript does not support chkconfig      Man Page Entry shows the below: > RUNLEVEL FILES Each service which should be manageable by chkconfig needs > two or more commented lines added to its init.d script. The **first line > tells chkconfig what runlevels** the service should be started in by > default, as well as the start and stop priority levels. If the service > should not, by default, be started in any runlevels, a - should be used in > place of the runlevels list. The **second line contains a description** for > the service, and may be extended across multiple lines with backslash > continuation. Is there any reason why the description of the script was made mandatory and is there any standard for defining the chkconfig scripts.


title: How to move windows across displays in Gnome 3?

text: In Gnome 3, moving windows with the keyboard shortcuts `Meta`+`<-` and `Meta`+`->` can be convenient. Now, I have two displays installed and would like to move windows across the displays without touching the mouse. More precisely, I would like to see what is the default behavior in Windows 7, namely four locations, left half of first screen, right half of first screen, left half of second screen, right half of second screen. Any solution involving a sequence of multiple shortcuts is also appreciated. Note that I am using only one desktop but multiple displays.


title: remove apostrophes and other marks files from apostrophes

text: How to remove apostrophes and other marks such as (Parkinson’s and Parkinson's ) from all text files in a directory and save the changes in each one of the files as in the directory


title: CapsLock as modifier key for application keymaps

text: I am developer and currently I am using Ubuntu Linux with PyCharm IDE for development of website. In order to improve typing performance I consider change CapsLock to Hyper_L and assign it to mod3 using xmodmap. After this I want to map mod3 for 'i' key to 'Up'. So far what I did is:               xmodmap -e "keysym Caps_Lock = Hyper_L"      output is like this:               shift       Shift_L (0x32),  Shift_R (0x3e)     lock        Hyper_L (0x42)     control     Control_L (0x25),  Control_R (0x69)     mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)     mod2        Num_Lock (0x4d)     mod3           mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)     mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)      then I remove Hyper_L from mod4               xmodmap -e "remove Mod4 = Hyper_L"      Afterwards I tried assign Hyper_L to mod3               xmodmap -e "add Mod3 = Hyper_L"      However I got error as following:               X Error of failed request:  BadValue (integer parameter out of range for operation)       Major opcode of failed request:  118 (X_SetModifierMapping)       Value in failed request:  0x17       Serial number of failed request:  11       Current serial number in output stream:  11      So, what was the problem here? How I can make it work? Does my approach is right? Or I should use different approach in order to use mod3 for custom keys? P.S. I am using Microsoft Natural Ergonomic 7000 keyboard


title: How to restrict one user files to another user

text: On my machine there are user accounts. My question is how to restrict access to ones user files. Meaning no one else can access my files at all. How can I setup this restriction? How many root users are possible for one Linux machine? **Edit:** I'm One of the user of my system with name `TOM`(actually my system has two users `TOM` and `JERRY`),I installed all the packages by using `root`. **for installing process**               yum install`<package name>`      **Restriction:** No one else access my package and file which are containing in `TOM` user


title: Command line to burn DVD+R DL media on Linux?

text: A Plextor PX-750A on a Linux system has made many DVD+R DL coasters while trying to burn an 8GB DVD .iso file with growisofs and the Schilling cdrecord program. I tried growisofs first:               growisofs --version     * growisofs by <appro@fy.chalmers.se>, version 7.0,       front-ending to genisoimage: genisoimage 1.1.8 (Linux)      The command line was:               growisofs -dvd-compat -Z /dev/sr1=SUU_14.03.00_A00.iso      Removal of the `-dvd-compat` option was also attempted. Schilling cdrtools was also tried:               Cdrecord-ProDVD-ProBD-Clone 3.00 (i686-pc-linux-gnu) Copyright (C) 1995-2010 Jörg Schilling      The command line was:               /usr/local/bin/cdrecord -v dev=ATAPI:1,0,0 SUU_14.03.00_A00.iso      In both cases, the burn aborts half way through as though it writes a layer and croaks when it should move to the second layer. growisofs:                4275175424/8434493440 (50.7%) @1.6x, remaining 22:03 RBU 100.0% UBU  94.4%     :-[ WRITE@LBA=1fdb40h failed with SK=3h/ASC=0Ch/ACQ=00h]: Input/output error     :-( write failed: Input/output error      cdrecord:               Track 01: 4205 of 8043 MB written (fifo  99%) [buf  97%]   2.4x./usr/local/bin/cdrecord: Input/output error. write_g1: scsi sendcmd: no error     CDB:  2A 00 00 20 DA 10 00 00 10 00     status: 0x2 (CHECK CONDITION)     Sense Bytes: 70 00 03 00 00 00 00 0A 00 00 95 00 0C 00 00 00 00 00     Sense Key: 0x3 Medium Error, Segment 0     Sense Code: 0x0C Qual 0x00 (write error) Fru 0x0     Sense flags: Blk 0 (not valid)     cmd finished after 0.019s timeout 200s          write track data: error after 4409294848 bytes     /usr/local/bin/cdrecord: A write error occured.     /usr/local/bin/cdrecord: Please properly read the error message above.      Looking at the media after the burn, it appears to have written data from the inside to the outside - giving the impression that it wrote one layer fully and then errored out when that layer ended. In several attempts, each failure is at about 50% of the way through the burn of:               $ ls -lh SUU_14.03.00_A00.iso     -rw-rw-r-- 1 user group 7.9G 2014-05-14 07:53 SUU_14.03.00_A00.iso      Begin 2014/05/23 edit: The cdrecord man page says:               Cdrecord functional options       ...       driveropts=option list         ...         layerbreak           Switch  a  drive  with  DVD-R/DL  medium  into layer jump           recording recording mode and  use  automatic  layer-break           position setup.                By  default,  DVD-R/DL  media  is  written  in sequential           recording mode that completely fills up both layers.              layerbreak=value           Set up  a  manual  layer-break  value  for  DVD-R/DL  and           DVD+R/DL.   The  specified  layer-break value must not be           set to less than half of the recorded data size and  must           not be set to more than the remaining Layer 0 size of the           medium.  The manual layer-break value needs to be a  mul-           tiple  of  the  ECC  sector size which is 16 logical 2048           byte sectors in case of DVD media  and  32  logical  2048           byte sectors in case of HD-DVD or BD media.                Cdrecord  does  not  allow to write DL media in case that           the total amount of data is less then the Layer 0 size of           the  medium  except  when  a  manual layer-break has been           specified by using the layerbreak=value option.      Use of layerbreak without a manually computed breakpoint gives:               cdrecord -v driveropts=layerbreak dev=ATAPI:1,0,0 SUU_14.03.00_A00.iso     ...     cdrecord: Bad layer break value ''.     ...      After some research, I found a patch to an older cdrecord that contained an "optimal layer break computation". With a little experimentation, I found that I could compute the "optimal layer break" in a shell:               echo -e "a = $(isosize SUU_14.03.00_A00.iso)\nb = a / 2048 / 2\nb - 1 + 16 - ( b - 1 ) % 16\n" | bc      This gave a layerbreak value of 2059216. In fact, for grins, I tried adjusting the value up and down. For some layerbreak values (like 2059215) cdrecord would report:               cdrecord: Layer break at 2059215 is not properly aligned.      Hopeful, I tried:               cdrecord -v driveropts=layerbreak=2059216 dev=ATAPI:1,0,0 SUU_14.03.00_A00.iso      And still got a coaster and write error:               Track 01: 4205 of 8043 MB written (fifo  99%) [buf  97%]   2.4x./usr/local/bin/cdrecord: Input/output error. write_g1: scsi sendcmd: no error     CDB:  2A 00 00 20 DB 60 00 00 10 00     status: 0x2 (CHECK CONDITION)     Sense Bytes: 70 00 03 00 00 00 00 0A 00 00 95 00 0C 00 00 00 00 00     Sense Key: 0x3 Medium Error, Segment 0     Sense Code: 0x0C Qual 0x00 (write error) Fru 0x0     Sense flags: Blk 0 (not valid)     cmd finished after 0.022s timeout 200s          write track data: error after 4409982976 bytes     /usr/local/bin/cdrecord: A write error occured.     /usr/local/bin/cdrecord: Please properly read the error message above.      End of 2014/05/23 edit. This issue occured on a server where there were no GUI tools installed. I am looking for a way to burn dual layer DVDs from the command-line.


title: backup inode table on ext2/3/4

text: is it possible, to backup on regular basis inode table (including all inode information) on ext2/3/4? If yes, how to do it, or which program to use?


title: init, syslog and stdout/stderr

text: I'm trying to build an embedded system with linux. (Means very few resources and not much else than busybox.) I'd like to make sure, that everything is going to syslog. I'm using the newest version of busybox (v.1.21.1), with the builtin init and syslogd. There's a few issues though. First the inittab:               ....     null::sysinit:/bin/sh /etc/rc     null::sysinit:/bin/touch /var/log/messages     null::respawn:/sbin/syslogd -n -S -s 12 -b 8     null::respawn:/sbin/klogd -n     ....      The rc script is run before syslog, which means that all usefull information from rc is lost. (I'm not sure, what the touch command is for btw.) I could start syslog before rc (null::sysinit:/sbin/syslogd...), but that would remove the very important 'respawn'. Also when 3rd party daemons are starting up, it could look like this:               ...     null::respawn:/bin/modbus     ...      If the daemon doesn't support syslog or if something slips (eg. a print to stderr) it is lost. I cannot seem to redirect output to syslog. Eg.               ...     console::respawn:/bin/modbus|logger 2>1     ...      I've tried a number of different combinations. Nothing seems to work well. Ofc, I could edit all the daemons and make them support syslog. (But what if something slips?) It could be solved if I could write something like this:               log::respawn:/bin/modbus      And actually, there is a /dev/log. But it's a socket, normal redirects won't work. ... so I could make it work through a custom kernel module. Eg. I could create a module that creates a /dev/syslog_link that writes everything to printk. Problem is that the syslog would mark all messages from that one as 'kernel'. Very wrong. So now I'm thinking that I could create a kernel module that writes to the /dev/log: http://stackoverflow.com/questions/1184274/how-to-read-write-files- within-a-linux-kernel-module https://www.cs.drexel.edu/~jjohnson/2012-13/fall/cs543/project/reading/kernel_fileio.pdf I don't know if it's possible though and writing to files from kernel space hurts my fragile sence of right and wrong. Any thoughts?


title: Run a process to particular/dedicated pid only

text: I have a c program executable or shell script which I want to run very often. If I want to stop/pause or to notify something I will send signal to that process. So every time I have to check the `pid` of that process and I have to use `kill` to send a signal. Every time I have to check pid and remembering that upto system shutdown, really bad. **I want that process has to run on particular`pid` only** like `init` always run on 1. Is there any C api for that? and Also needed script for bash program.


title: Use a bash function in a pipelined command

text: I have a command similar to: `... | sort -u -V`. Since some versions of `sort` do not support the `-V` flag, I thought it would be great if I made a function that conditionally adds the flag. But, it seems that my implementation does not work in a pipelined command. Here's what I've tried:               function sort_by_version {         if $(sort -u -V &>/dev/null); then             sort -u -V         else             sort -u         fi     }      and               git log -n 10 --format="%s" | sort_by_version      How can I make this work or what other better approached are there?


title: Does $SHELL store the path to the default shell in Linux?

text: My administrator says that my default shell is set to `bash`, but               $ echo $SHELL     /bin/csh     $      Is the default shell related to the `SHELL` variable at all? Is not, what is the variable used for?


title: How to detect SLES version?

text: What patchlevel does this SLES machine has? 10.2 or 10.4?               SERVER:~ # cat /etc/issue     SUSE LINUX Enterprise Server 10.2     Kernel \r (\m), \l     SERVER:~ #           SERVER:~ # cat /etc/SuSE-release      SUSE Linux Enterprise Server 10 (x86_64)     VERSION = 10     PATCHLEVEL = 4     SERVER:~ #       UPDATE:               SERVER:/etc # rpm -V sles-release     S.5....T  c /etc/issue     S.5....T  c /etc/issue.net     S.5....T  c /etc/motd          SERVER:/etc # zypper sl     # | Enabled | Refresh | Type | Name                                                | URI                                                                        --+---------+---------+------+-----------------------------------------------------+-----------------------------------------------------------------------     1 | No      | No      | YaST | SUSE Linux Enterprise Server 10 SP2                 | cd:///?devices=/dev/hda                                                    2 | Yes     | Yes     | YaST | SUSE Linux Enterprise Server 10 SP2-20110317-171027 | nfs://123.123.123.123/usr/sys/inst.images/Linux/SuSE/SLES10_x86_64/10.2          SERVER:/etc # uname -r     2.6.16.60-0.91.1-smp      UPDATE #2:               SERVER:/etc # cat /etc/issue.rpmnew          Welcome to SUSE Linux Enterprise Server 10 SP4  (x86_64) - Kernel \r (\l).      UPDATE #3               SERVER:/etc #           SERVER:~ # rpm -qi glibc     Name        : glibc                        Relocations: (not relocatable)     Version     : 2.4                               Vendor: SUSE LINUX Products GmbH, Nuernberg, Germany     Release     : 31.95.1                       Build Date: Mon Sep 19 16:43:25 2011     Install Date: Sun Mar 18 08:01:27 2012      Build Host: macintyre     Group       : System/Libraries              Source RPM: glibc-2.4-31.95.1.src.rpm     Size        : 5141247                          License: BSD 3-Clause; GPL v2 or later; LGPL v2.1 or later     Signature   : DSA/SHA1, Mon Sep 19 16:45:00 2011, Key ID a84edae89c800aca     Packager    : http://bugs.opensuse.org     URL         : http://www.gnu.org/software/libc/libc.html     Summary     : Standard Shared Libraries (from the GNU C Library)     Description :     The GNU C Library provides the most important standard libraries used     by nearly all programs: the standard C library, the standard math     library, and the POSIX thread library.  A system is not functional     without these libraries.     Distribution: SUSE Linux Enterprise 10     SERVER:~ #


title: How to find and replace string without use command Sed?

text: As we all know, `sed` is greatly efficient to find and replace string, for example find 'a' and replace it to 'b': `sed 's/a/b/g'`. Is it possible to do this with other command or shell script instead of `sed`? This is for a cropped linux systems for TV that does have not the sed command. So I has to use other commands or scripts instead of `sed 's/a/b/g'. –`


How to attach my domain with bind in real wwwI install bind9, with apache. By God's very grace every thing went smooth. my dig, host, nslookup and ping provide this info: my system ip address: 59.177.154.251 my domain name: imsingh.com my domain registrar: GoDaddy.com When i write imsingh.com in my system browser's address bar the website opens properly. **my question: What I need todo further so that imsingh.com opens the website hosted on my system.** when I or You, or anyone else clicks www.imsingh.com then _the website hosted on my system is not launched._ I want to know how **i should change namesever with ns1.imsingh.com & ns2.imsingh.com** at GoDaddy.com because when i change them GoDaddy says `nameserver not registered`                           # dig imsingh.com                      ; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> imsingh.com                 ;; global options: +cmd                 ;; Got answer:                 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15453                 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2                      ;; QUESTION SECTION:                 ;imsingh.com.           IN  A                      ;; ANSWER SECTION:                 imsingh.com.        86400   IN  A   59.177.154.251                      ;; AUTHORITY SECTION:                 imsingh.com.        86400   IN  NS  NS1.imsingh.com.                 imsingh.com.        86400   IN  NS  NS2.imsingh.com.                      ;; ADDITIONAL SECTION:                 NS1.imsingh.com.    86400   IN  A   59.177.154.251                 NS2.imsingh.com.    86400   IN  A   59.177.154.251                      ;; Query time: 0 msec                 ;; SERVER: 127.0.0.1#53(127.0.0.1)                 ;; WHEN: Fri Aug  9 16:01:25 2013                 ;; MSG SIZE  rcvd: 113                      # host imsingh.com                 imsingh.com has address 59.177.154.251                 imsingh.com mail is handled by 10 MX1.imsingh.com.                      # nslookup imsingh.com                 Server:     127.0.0.1                 Address:    127.0.0.1#53                      Name:   imsingh.com                 Address: 59.177.154.251                           # ping imsingh.com                 PING imsingh.com (59.177.154.251) 56(84) bytes of data.                 64 bytes from IMSINGH.COM (59.177.154.251): icmp_req=1 ttl=254 time=0.539 ms                 64 bytes from IMSINGH.COM (59.177.154.251): icmp_req=2 ttl=254 time=0.535 ms                 64 bytes from IMSINGH.COM (59.177.154.251): icmp_req=3 ttl=254 time=0.529 ms                 64 bytes from IMSINGH.COM (59.177.154.251): icmp_req=4 ttl=254 time=0.534 ms                 64 bytes from IMSINGH.COM (59.177.154.251): icmp_req=5 ttl=254 time=0.534 ms                 ^C                 --- imsingh.com ping statistics ---                 5 packets transmitted, 5 received, 0% packet loss, time 3997ms                 rtt min/avg/max/mdev = 0.529/0.534/0.539/0.014 ms      Data for ip address                           # dig -x 59.177.154.251                      ; <<>> DiG 9.8.4-rpz2+rl005.12-P1 <<>> -x 59.177.154.251                 ;; global options: +cmd                 ;; Got answer:                 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 27574                 ;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1                      ;; QUESTION SECTION:                 ;251.154.177.59.in-addr.arpa.   IN  PTR                      ;; ANSWER SECTION:                 251.154.177.59.in-addr.arpa. 604800 IN  PTR IMSINGH.COM.                      ;; AUTHORITY SECTION:                 59.in-addr.arpa.    604800  IN  NS  IMSINGH.COM.                      ;; ADDITIONAL SECTION:                 IMSINGH.COM.        86400   IN  A   59.177.154.251                      ;; Query time: 0 msec                 ;; SERVER: 127.0.0.1#53(127.0.0.1)                 ;; WHEN: Fri Aug  9 16:05:06 2013                 ;; MSG SIZE  rcvd: 100                           # host 59.177.154.251                 251.154.177.59.in-addr.arpa domain name pointer IMSINGH.COM.                           # host 59.177.154.251                 251.154.177.59.in-addr.arpa domain name pointer IMSINGH.COM.                           # ping 59.177.154.251                 PING 59.177.154.251 (59.177.154.251) 56(84) bytes of data.                 64 bytes from 59.177.154.251: icmp_req=1 ttl=254 time=0.679 ms                 64 bytes from 59.177.154.251: icmp_req=2 ttl=254 time=0.529 ms                 64 bytes from 59.177.154.251: icmp_req=3 ttl=254 time=0.533 ms                 64 bytes from 59.177.154.251: icmp_req=4 ttl=254 time=0.689 ms                 64 bytes from 59.177.154.251: icmp_req=5 ttl=254 time=0.523 ms                 ^C                 --- 59.177.154.251 ping statistics ---                 5 packets transmitted, 5 received, 0% packet loss, time 3998ms                 rtt min/avg/max/mdev = 0.523/0.590/0.689/0.080 ms


title: Execute All Cronjobs in ~/.zshenv Environment

text: I want to execute all cronjobs in the environment defined in my ~/.zshenv, and I want to redirect `STDOUT` and `STDERR` of every cronjob to a single log file. I am on OS X 10.9. What is the cleanest way to achieve this?


title: Why do tar and gzip files usually have a file extension?

text: File extensions are not necessary on unices, still every tarred, gzipped or bzipped file I encounter has a file extension like `.tar`, `.tar.gz` or `.tgz`. Is there any special reason for that or is that just convention?


title: Installed software back-up

text: I have Linux Mint 15 Mate installed on one PC and I am currently updating it and installing necessary language packs, software, etc. After full set up can I back-up the entire system and restore it on another PC running same version of Linux (Mint 15 Mate)? Or at least restore all updated files and software? I am on limited Internet access and traffic is costly :(


title: Can't login to remote debian system with RSA key and ssh.exe from Cygwin

text: I need to login to a Debian server using `ssh.exe` from Cygwin. I've generated an RSA key and appended it to the `authorized_keys` file. Debian is OK, because I was able to use the RSA key using PuTTY to login there. However when I try to login with `ssh.exe` it says that the password is incorrect. I can't access the `./ssh/` folder from Cygwin. Update: As I suspected, adding `-vvvv` shows the following:               debug1: could not open key file '/home/steve/.ssh/id_rsa': Permission denied      The file is there and I can view `C:\cygwin\home\steve\.ssh\id_rsa` by my file manager. Update 2:               ls -lA ~/     drwx------+ 1 steve None         0 фев 27 13:20 .ssh          $ ls -l ./.ssh/     ls: невозможно открыть каталог ./.ssh/: Permission denied      How can I fix this?


title: Use virt-manager to share files between Linux host and Windows guest?

text: Is it possible to use "Filesystem Passthrough" virtual hardware option inside virt-manager to share a folder on my Linux host with my Windows guest? I found some tutorials for how to do this with a Linux guest, but when I try this with my Windows guest I receive the following error message when attempting to start the VM:               Error starting domain: Unable to read from monitor: Connection reset by peer          Traceback (most recent call last):   File "/usr/share/virt-manager/virtManager/asyncjob.py", line 100, in cb_wrapper         callback(asyncjob, *args, **kwargs)   File "/usr/share/virt-manager/virtManager/asyncjob.py", line 122, in tmpcb         callback(*args, **kwargs)   File "/usr/share/virt-manager/virtManager/domain.py", line 1210, in startup         self._backend.create()   File "/usr/lib64/python2.7/site-packages/libvirt.py", line 698, in create         if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)     libvirtError: Unable to read from monitor: Connection reset by peer      I tried sourcing some documentation but all I could find was the official page linking to a FAQ and "some screenshots".


title: How to avoid parsing /etc/* files

text: When starting my shell with e.g. `exec zsh` from the command line, how can I have it **not** parse any /etc/ files? I read in the zsh guide that when a user starts a zsh shell, it processes the following init files in order:               # Every shell. Always     /etc/zshenv          # Every shell. Avoidable if passing flag -f to zsh     ~/zshenv          # If it's a login shell.     /etc/zprofile     ~/zprofile          # If it is an interactive shell     /etc/zshrc     ~/zshrc          # If it is a login shell     /etc/zlogin     ~/zlogin      When starting `zsh`, I would like to skip processing all the `/etc/*` files (except `/etc/zshenv` which I assume I can't skip as a non-root user?), and **only** parse my own init files in my home directory. How can I do this when I invoke `exec zsh` from the command line?


title: what's the purpose of ssh-agent?

text: I've read the official definition: _ssh-agent is a program to hold private keys used for public key authentication (RSA, DSA, ECDSA). The idea is that ssh-agent is started in the beginning of an X-session or a login session, and all other windows or programs are started as clients to the ssh-agent program. Through use of environment variables the agent can be located and automatically used for authentication when logging in to other machines using ssh(1)._ **"..a program to hold private keys.."** \- IMHO - ssh keys are generated by user with ssh-keygen command and simply& straightforward stored in ~/.ssh - why do I need some daemon to hold these keys? How exactly does it hold them anyways - aren't they just stored in .ssh? **"are started as clients to the ssh-agent program"** \- I don't get it. Where would one need that? I usually just use ssh as this:                ssh -i ~/.ssh/private_key_name username@hostname      What exactly does manual means by "clients" - what clients? Don't you just run ssh command from terminal to connect - what other clients are there and why can't they just use a path to that ssh private file, just like ssh command?


title: bash: different output between CTRL-C vs "ordered cleanup"

text: I really tried to find a better title for this question. I am open for suggestions. I've written a bash script that traps `EXIT` and calls a function if that signal is received. It calls the same function when a file called `stop` exists. Here it is:               #!/bin/bash          TAIL_PID=0     CAT_PID=0          DEVICE=/dev/ttyACM0     WDIR=plasma     LOGFILE=$WDIR/$(date +%Y%m%d_%H%M%S.log)     CMDFILE=$WDIR/toDevice          function kill_tail     {       if [ $TAIL_PID -ne 0 ]       then         kill $TAIL_PID         TAIL_PID=0         echo "killed tail"       fi     }          function kill_cat     {       if [ $CAT_PID -ne 0 ]       then         kill $CAT_PID         CAT_PID=0         echo "killed cat"       fi     }          function on_die     {       echo 't 0' >> $DEVICE       kill_tail       kill_cat       echo "stopped logging"     }     trap on_die EXIT          # mount plasma oven directory if it is not already mounted     mountpoint -q $WDIR || sshfs user@server:plasma $WDIR         # see if device is available/wait for device     while [ ! -c $DEVICE ]     do       sleep 1     done     echo "Found controller"          # stop output, remove start and stop files     echo 't 0' >> $DEVICE     rm $WDIR/start $WDIR/stop          # outer loop     while [ 1 ]     do       while [ ! -f $WDIR/start ]       do         sleep 1       done       rm $WDIR/start            # stop output       echo 't 0' >> $DEVICE            # pass commands to device       # but clear existing commands first       > $CMDFILE       tail -f $CMDFILE > $DEVICE &       TAIL_PID=$!       echo "tail PID = " $TAIL_PID            # start logging       cat $DEVICE >> $LOGFILE &       CAT_PID=$!       echo "cat PID = " $CAT_PID            # start output       echo 't 1000' >> $DEVICE       echo "started logging to " $LOGFILE            while [ ! -f $WDIR/stop ]       do         sleep 1       done       rm $WDIR/stop            on_die          done # end of outer loop      When I run this script, after `touch start`, it gives me different output depending on whether I `CTRL-C` or `touch stop`. This is the output after `CTRL-C`ing:               killed tail     killed cat     stopped logging      This is the output after `touch stop`:               killed tail     killed cat     stopped logging     ./mountPlasma: line 93: 21200 Terminated              tail -f $CMDFILE > $DEVICE     ./mountPlasma: line 93: 21201 Terminated              cat $DEVICE >> $LOGFILE      Why? The same function is called, and I would expect the same output from both calls to `on_die`. The output indicates that the two extra messages are emitted on line 93, which is `done # end of outer loop` (the line number does not exactly match the code above, as I had to remove a few lines for this post). As I am very unexperienced with bash, I don't know if there are any side- effects to this. Both `tail`and `cat` are killed as expected.


title: (e)grep and atomic grouping [comprehension question]

text: I am trying to understand the correct use of » _atomic grouping_ « a.k.a. » _independent subexpressions_ « a.k.a. » _non-backtracking subpattern_ « [this are the terms I found for the same thing, which doesn't make it less complicate]   * `egrep '123(?>fruit|juiceomatic)machine'` means: look for `123fruitjuiceomaticmachine`   * BUT **stop trying to match** [the rest of] the round brackets' content if `123` is followed by anything else than `fruit`! **Is this correct? Did I miss something important?** I ask this because I got to the expected results most of the time but I am not 100% sure if this is because I did it right or I just made lucky guesses.


title: Why do fonts in Debian not look as beautiful as in Ubuntu

text: I changed my OS from Ubuntu to Debian but I found that fonts do not look as beautiful as they used to anymore. Especially in stackexchange, every character grows thick and bold and not smooth. How can I improve that?


title: Install Linux on PPC Mac: NO CD DRIVE

text: I am trying to install Linux on my Xserve G4, a NewWorld PPC Macintosh computer. The issue is: I have no CD drive, so all those helpful comments like "Just boot from Linux using a LiveCD" don't work for me. I have disk images. I have a spare hard-drive that I can reformat until the blocks go bad.   1. Is it possible to boot from a Linux disk with the standard PPC OpenFirmware bootloader?   2. If not, how do I boot into Linux? All steps must be taken from the FreeBSD platform known as Mac OSX, or OpenFirmware I asked a similar question on the AskDifferent forum, no more than 20 views and no replies, so I am coming here. Thank you all.


title: How to remove duplicate lines in a large multi-GB textfile?

text: My question is similar to this question but with a couple of different constraints:   * I have a large `\n` delimited wordlist -- one word per line. Size of files range from 2GB to as large as 10GB.    * I need to remove any duplicate lines.    * The process may sort the list during the course of removing the duplicates but not required.   * There is enough space on the partition to hold the new unique wordlist outputted. I have tried both of these methods but they both fail with out of memory errors.               sort -u wordlist.lst > wordlist_unique.lst                    awk '!seen[$0]++' wordlist.lst > wordlist_unique.lst     awk: (FILENAME=wordlist.lst FNR=43601815) fatal: assoc_lookup: bucket-ahname_str: can't allocate 10 bytes of memory (Cannot allocate memory) What other approaches can I try?


title: Why's my FreeBSD OpenJDK port update failing (and how do I fix it)?

text: Makes good progress for the first half hour or so, then dies at:               cd bsd_amd64_compiler2/product && ./test_gamma     Using java runtime at: /usr/local/openjdk7/jre     Error occurred during initialization of VM     java/lang/NoClassDefFoundError: java/lang/invoke/AdapterMethodHandle     gmake[4]: *** [product] Error 1     gmake[4]: Leaving directory `/usr/ports/java/openjdk7/work/openjdk/build/bsd-amd64/hotspot/outputdir'     gmake[3]: *** [generic_build2] Error 2     gmake[3]: Leaving directory `/usr/ports/java/openjdk7/work/openjdk/hotspot/make'     gmake[2]: *** [product] Error 2     gmake[2]: Leaving directory `/usr/ports/java/openjdk7/work/openjdk/hotspot/make'     gmake[1]: *** [hotspot-build] Error 2     gmake[1]: Leaving directory `/usr/ports/java/openjdk7/work/openjdk'     gmake: *** [build_product_image] Error 2     *** [do-build] Error code 1      I'm really at a loss. Previous versions built fine. Doing my updates via the portsnap fetch/update then portmaster -a path. OpenJDK, Apache, and Ruby are the only updates of note this time around. Searching only came up with a couple hits (of the "oh, this is broke" followed by "oh it works now" with no explanation on _how_ it was made to work)...


title: Scheduled task on reboot

text: How can I schedule a task to run on next reboot? I understand that we have tools like `cron` and `at` to help with scheduling. But they seem to allow scheduling at a specific time and not on specific event (like rebooting).


title: setting up an IRC server on freebsd

text: ssh port forward to access my home machine from anywhere In continuation to what I've been trying to do, I want to setup an `IRC` chat server on my freebsd box at home so friends can join that server and we can chat. I believe, I need to run IRC server on a port and advertise/forward/expose that port to outside world. - this is my understanding. Please correct me if I am wrong. How can I do that?


title: Dynamically change desktop background from bash script

text: Is it possible to change the GNOME desktop background during some period of time by just a random phrase from the list on black screen? Will is seriously load the CPU and consume battery life?


title: What should I do with a remote AIX machine if I accidentally "chmod 644"-ed the "/usr/bin/ksh"?

text: Now the machine asks for password...The ssh was configured with key auth.. The problem is that ksh doesn't has executable permission anymore.. :\ What can I do remotely? Any tips?      The root's shell was ksh.. :\ p.s.: there aren't any users that use a non-ksh shell+remote login enabled.


title: Setting same gtk/openbox theme in both 64 bit native and 32 bit chroot environment

text: I'm running Arch Linux and have setup a 32bit chroot environment inside a 64bit native install per their wiki instructions. I've installed the Zukitwo and Zukitwo-Openbox themes via the Arch Linux AUR, which install to `/usr/share/themes/Zukitwo`. I'm setting my theme via `obconf` (for openbox) and `lxappearance` (for gtk apps). For some reason, when setting gtk theme with `lxappearance` in the 64bit native environment, my 32bit chroot apps default to the Raleigh theme (looks like Win 3.1). If I enter the chroot and use `lxappearance` to set the same theme (which I've installed in the chroot as well), the 64bit native environment applications switch to Raleigh theme. Since this should just be making changes to, as far as I know, `~/.config/gtk-3.0/settings.ini`, why might my theme not be consistent between the two environments? If it helps, here is the script that starts the 32bit chroot at boot (removed stop case to minimize post length):               #!/bin/bash          dirs=(/dev /dev/pts /dev/shm /tmp /home)          case $1 in         start)             for d in "${dirs[@]}"; do               mount -o bind $d /opt/arch32/$d             done             mount -t proc none /opt/arch32/proc             mount -t sysfs none /opt/arch32/sys             ;;              stop) [... removed ...]     esac      `/home` gets mounted, so the two should just be bound in the chroot and they're sharing the same home directory, right? (Using `diff` on settings.ini in ~/.config/gtk-3.0/settings.ini and /opt/arch32/home/username/.config/gtk-3.0/settings.ini reveals no differences.)


title: Package a Linux system and app into an installable .iso? Kickstart?

text: I have written a Python web app that has a number of dependancies. In addition to providing install instructions, I would like to package this up into an .iso for ease of installation. Something similar to what Fully Automated Nagios does. What is the best way to approach this? Is Kickstart what I'm looking for?


title: Conditionally killing a process based on its output

text: I have a REPL (read-eval-print-loop) for the Clojure programming language listening on a network socket. I can send it code over the network and the code will be evaluated and the answer sent back to me. I'm using the `netcat` utility to send the code               # send the contents of code.txt to port 5678 on somemachine     $ netcat somemachine 5678 <code.txt      My problem is that I don't want to use the _Loop_ capability of this REPL. On my end, I want to issue a one-shot command, receive and show the answer on stdout, then exit my command (the REPL on the remote machine should stay up). The below example works except `netcat` doesn't exit and I remain connected to the REPL indefinitely.               $ cat code.txt     (doseq [x (range 0 10)] (println (* x x)))     $ netcat somemachine 5678 <code.txt     user=> 0     1     4     9     16     25     36     49     64     81     nil     user=>      We can see that the REPL's prompt ("user=> ") is displayed twice: once before the code is evaluated and once after. It seems like the key to getting what I want is chaining something on to the end of my command that watches and waits until the prompt is shown a second time then kills `netcat`. When running this manually in a bash terminal, I could instead just press Ctrl-C after I see the second prompt, but the purpose of this is to be used in an extension to the TextMate editor. Any ideas?


title: Find out what device /dev/root represents in Linux?

text: On linux, there is a `/dev/root` device node. This will be the same block device as another device node, like `/dev/sdaX`. How can I resolve `/dev/root` to the 'real' device node in this situation, so that I can show a user a sensible device name? For example, I might encounter this situation when parsing `/proc/mounts`. I'm looking for solutions that would work from a shell/python script but not C.


title: Is there a tomcat 64 bit version

text: Is there a tomcat 64 bit version for Linux, I am using Red Hat Linux?.


title: Unable to mount a second hard drive in Ubuntu Server

text: I am adding a second drive to my Ubuntu Server. It was previously in a FreeNas system, but I got rid of the XFS partition and created an ext4 partition (in an older Ubuntu system). I then backed up all my data onto it, then installed the disk in my Ubuntu Server. dmesg | tail               [  294.570830] EXT4-fs (sdb): VFS: Can't find ext4 filesystem     [  365.523173] exe (1269): /proc/1269/oom_adj is deprecated, please use /proc/1269/oom_score_adj instead.     [  516.249248] EXT4-fs (sdb): VFS: Can't find ext4 filesystem     [  518.965799] EXT3-fs (sdb): error: can't find ext3 filesystem on dev sdb.      I also have a testdisk.log file as follows               Thu Jul 28 19:40:00 2011     Command line: TestDisk          TestDisk 6.11, Data Recovery Utility, April 2009     Christophe GRENIER <grenier@cgsecurity.org>     http://www.cgsecurity.org     OS: Linux, kernel 2.6.38-8-server (#42-Ubuntu SMP Mon Apr 11 03:49:04 UTC 2011)     Compiler: GCC 4.5 - Oct 17 2010 19:13:58     ext2fs lib: 1.41.14, ntfs lib: 10:0:0, reiserfs lib: none, ewf lib: none     /dev/sda: LBA, HPA, LBA48, DCO support     /dev/sda: size       3907029168 sectors     /dev/sda: user_max   3907029168 sectors     /dev/sda: native_max 18446744073321613488 sectors     /dev/sda: dco        18446744073321613488 sectors     /dev/sdb: LBA, HPA, LBA48, DCO support     /dev/sdb: size       3907029168 sectors     /dev/sdb: user_max   3907029168 sectors     /dev/sdb: native_max 18446744073321613488 sectors     /dev/sdb: dco        18446744073321613488 sectors     Warning: can't get size for Disk /dev/mapper/control - 0 B - CHS 1 1 1, sector size=512     Hard disk list     Disk /dev/sda - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ATA ST32000542AS     Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63, sector size=512 - ATA ST32000542AS          Partition table type (auto): EFI GPT     /dev/sdb: Host Protected Area (HPA) present.     Disk /dev/sdb - 2000 GB / 1863 GiB - ATA ST32000542AS     Partition table type: EFI GPT          Analyse Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63     hdr_size=92     hdr_lba_self=1     hdr_lba_alt=3907029167 (expected 3907029167)     hdr_lba_start=34     hdr_lba_end=3907029134     hdr_lba_table=2     hdr_entries=128     hdr_entsz=128     Current partition structure:      1 P FreeBSD Swap                 128    4194431    4194304 [swap-ada0]      2 P Unknown                  4194432 3907029134 3902834703 [ada0]          search_part()     Disk /dev/sdb - 2000 GB / 1863 GiB - CHS 243201 255 63          recover_EXT2: s_block_group_nr=0/14888, s_mnt_count=5/25, s_blocks_per_group=32768, s_inodes_per_group=8192     recover_EXT2: s_blocksize=4096     recover_EXT2: s_blocks_count 487854337     recover_EXT2: part_size 3902834696          MS Data                  4194432 3907029127 3902834696 [D1]          EXT4 Large file Sparse superblock, 1998 GB / 1861 GiB          Results        P MS Data                  4194432 3907029127 3902834696 [D1]          EXT4 Large file Sparse superblock, 1998 GB / 1861 GiB          interface_write()      1 P MS Data                  4194432 3907029127 3902834696 [D1]     write!     No extended partition     You will have to reboot for the change to take effect.          TestDisk exited normally.      I don't mean to just dump log files and ask someone else to "make it work" but I find that in this case the testdisk.log would provide better incite than my explanation. I would really like to be able to use this drive without having to reformat it. Any help would be greatly appreciated!


title: Force telnet / ssh to use crtl-H for backspace

text: I have some devices connected to a Cisco serial term server; many work fine when I `telnet` directly to the port on the Cisco. However, I have a few stubborn devices that will not use `Backspace` as it is mapped in telnet by default. In case it matters, I telnet from `rxvt` under Debian squeeze (in an X Window). `TERM` is set to `rxvt`, but it doesn't matter whether I use `vt100`, `vt101`, or `xterm`... changing `TERM` has no effect. I started down the road of changing `TERM` based on what I saw in an old Kermit FAQ. FWIW, `stty erase ^h` and `stty erase ^?` don't work either. I have noticed that `Backspace` works correctly on these devices if I use a raw TCP socket from `netcat`... i.e. `nc 192.168.12.117 2006`; however, then I run into other issues with passwords not hidden or terminal paging. How can I selectively force telnet and ssh to map `Backspace` to `Ctrl``H` for these devices? Also, what criteria should I use to evaluate whether this is a bug in the device? ## EDIT In case it matters, this is the output from `showkey -a` for the keys in question... `^?` corresponds to `Backspace` and `^H` is `Ctrl``H`. It seems like I should be getting close when I look at The Linux Keyboard and Console Howto, but I can't seem to decipher what I can do to change this. I have tried various incantations with `loadkeys` to no effect.               [mpenning@hotcoffee docs]$ sudo showkey -a          Press any keys - Ctrl-D will terminate this program          ^?      127 0177 0x7f     ^H        8 0010 0x08      I am also including relevant output from `dumpkeys` as well... this is the current mapping in my system (which doesn't work on some devices in question). If I could figure out how to get `Backspace` to do the same thing as `Ctrl``H`, I would have a solution.               [mpenning@hotcoffee docs]$ sudo dumpkeys | grep -Ei "backspace|127"     keycode   8 = BackSpace        ampersand        braceleft            keycode  14 = BackSpace        Delete                       control keycode  14 = BackSpace            keycode 127 =     [mpenning@hotcoffee docs]$


title: How to block yum from upgrading obsoleted package?

text: Is there any way to prevent yum from upgrading a package obsoleted by another? I have created a custom repo containing some packages, among them **`openh323-devel`**. In current versions of CentOS, **`openh323`** is marked as being obsoleted by OPAL, but I don't want to compile other software (namely YATE) against OPAL. I have **`openh323-devel`** installed, but every time I do `yum update`, it wants me to upgrade it to OPAL. Is there any way I can tell **`yum`** that I permanently don't want to use OPAL (or any other superseding package for that matter) in a manner similar to apt pinning? Of course, I can `--exclude` specific packages, but that's not what I want.


title: How can I save/restore window positions when I undock/dock my laptop?

text: I have a laptop with a docking station that has a large monitor connected to it. When the laptop is docked, I use the monitor as my primary display, and the laptop screen as a secondary display. When I undock, the laptop screen becomes my primary display, and all the windows move over to it. When I dock the laptop, the monitor automatically becomes the primary display again, but the windows all stay on the laptop screen. I have to drag each one over to the monitor and resize it. **How can I get my windows to automatically resume the positions and sizes they had just before I undocked (assuming they're still open)?** All I've been able to find are answers talking about restoring programs when you log in. That's not what I'm looking for. I'm using Gnome 3 on Arch Linux.


title: How to copy text to xterm

text: How to paste text in a xterm? Now I can copy text from xterm to an outside application, like Firefox, by highlighting the text there. But I can not copy text from firefox to xterm. I am just normal user of linux system and dont have root access to install patches. Is there any workaround? System information is Linux version 2.6.18 (... @hs20-bc1-7. Build. Redhat. Com) Edit: One important fact I forgot to mention is that I'm using RealVNC to connect to the Linux server. Right-click works fine for prompt in my local Linux, but not the remote instance.


title: Too much installing and uninstalling?

text: Is this a problem on Linux like it is one Windows? Installing and uninstalling things that end up leaving behind little bits and pieces that accumulate and have a negative effect? If so, what can I do to prevent this?