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

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.


How to automatically apply changes in a folder to another?

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?


Virtual address of Global variables in Kernel code

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.


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

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?


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

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.


Errors building XScreensaver for X11 (and dependencies) on Mac

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?


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

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.)


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

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.


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

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?


Opening a usable xterm window through bash script

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?


mpg321 doesn't autoplay songs

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?


Enable Bash-Completion to expand Superuser executables to full path

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?


sed - find string and append

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


set gnome terminal background/text color from bash script

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)


date, get current 15 minute interval

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.


How to fix a Live-OS image that says Invalid

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


Variable substitution into a sed script

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!


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

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


CentOS: Sharing WLAN for internet access

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?


chkconfig format not accepted in rhel

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.


How to move windows across displays in Gnome 3?

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.


remove apostrophes and other marks files from apostrophes

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


CapsLock as modifier key for application keymaps

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


How to restrict one user files to another user

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


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

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.


backup inode table on ext2/3/4

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?


init, syslog and stdout/stderr

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?


Run a process to particular/dedicated pid only

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.


Use a bash function in a pipelined command

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?


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

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?


How to detect SLES version?

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:~ #


How to find and replace string without use command Sed?

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


Execute All Cronjobs in ~/.zshenv Environment

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?


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

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?


Installed software back-up

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 :(


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

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?


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

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".


How to avoid parsing /etc/* files

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?


what's the purpose of ssh-agent?

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?


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

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.


(e)grep and atomic grouping [comprehension question]

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.


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

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?


Install Linux on PPC Mac: NO CD DRIVE

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.


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

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?


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

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)...


Scheduled task on reboot

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).


setting up an IRC server on freebsd

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?


Dynamically change desktop background from bash script

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?


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

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.


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

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.)


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

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?


Conditionally killing a process based on its output

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?


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

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.


Is there a tomcat 64 bit version

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


Unable to mount a second hard drive in Ubuntu Server

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!


Force telnet / ssh to use crtl-H for backspace

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]$


How to block yum from upgrading obsoleted package?

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.


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

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.


How to copy text to xterm

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.


Too much installing and uninstalling?

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?


How to connect to an 802.1x wireless network via nmcli

I am able to connect to 802.1 networks via the nm-applet. I do not like doing this as I am running without a nm most of the time and I would hate to load up one just to connect to a wireless network. When connecting to an 802.1 network I get the following error:               Error: Failed to add/activate new connection: (32) Failed to determine AP security information      I do not know how to work around this as nmcli does not seem to provide any means of specifying the network type.


iptables correctness verification

I have so many questions around `iptables` and how it works. But we're using a modified kernel, and hence whatever experiment I try and fail, I can't be sure if it happens with Linux in common or just this kernel, as many modules are removed. So, as of now, I have a requirement. We have 2 apps running on top of 2 Linux instances, and these both apps communicate with each other through port 42605. In total, port 42605, 22, and ICMP are the ones I wanted to allow for communication between these 2 instances. I wanted to quickly verify this. With the `iptables` rule I tried, I couldn't verify this. So, modified the existing rules in the Linux instances and finally the below rule works for me. I have these rules set in both the Linux instances, and both apps are able to communicate between each other now. Am I doing it right? Or is there any loophole in these rules?               [root@localhost ~]# vi /etc/sysconfig/iptables     # Generated by iptables-save v1.4.7 on Sun Mar 16 03:56:09 2014     *nat     :PREROUTING ACCEPT [13049:3908712]     :POSTROUTING ACCEPT [62301:3240130]     :OUTPUT ACCEPT [62358:3244501]     COMMIT     # Completed on Sun Mar 16 03:56:09 2014     # Generated by iptables-save v1.4.7 on Sun Mar 16 03:56:09 2014     *filter     :INPUT DROP [0:0]     :FORWARD DROP [0:0]     :OUTPUT DROP [0:0]     :LOG_ACCEPT - [0:0]     :LOG_DROP - [0:0]     :icmp_packets - [0:0]     -A INPUT -p tcp -m state --state NEW,ESTABLISHED -m tcp --dport 8001 -j ACCEPT     -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT     -A INPUT -p tcp -m tcp --dport 22 -j LOG_ACCEPT     -A INPUT -p udp -m udp --dport 22 -j LOG_ACCEPT     -A INPUT -p tcp -m tcp --dport 42605 -j ACCEPT     -A INPUT -s 127.0.0.1/32 -j ACCEPT     -A INPUT -i lo -j ACCEPT     -A INPUT -s 127.0.0.1/32 -d 127.0.0.1/32 -j ACCEPT     -A INPUT -p icmp -j icmp_packets     -A INPUT -j LOG_DROP     -A OUTPUT -m state --state RELATED,ESTABLISHED -j ACCEPT     -A OUTPUT -p tcp -m tcp --dport 22 -j ACCEPT     -A OUTPUT -p udp -m udp --dport 22 -j ACCEPT     -A OUTPUT -p tcp -m tcp --dport 42605 -j ACCEPT     -A OUTPUT -d 127.0.0.1/32 -j ACCEPT     -A OUTPUT -o lo -j ACCEPT     -A OUTPUT -p icmp -j icmp_packets     -A OUTPUT -j LOG_DROP     -A LOG_ACCEPT -j LOG --log-prefix "[IPTABLES ACCEPT] : " --log-tcp-options --log-ip-options     -A LOG_ACCEPT -j ACCEPT     -A LOG_DROP -j LOG --log-prefix "[IPTABLES DROP] : " --log-tcp-options --log-ip-options     -A LOG_DROP -j DROP     -A icmp_packets -p icmp -m icmp --icmp-type any -j ACCEPT     COMMIT     # Completed on Sun Mar 16 03:56:09 2014


Strip color on OS X with BSD sed (or any other tool)

I'm on OS X, which has a BSD version of `sed` (which I'm guessing is inferior to a GNU version on Linux), and all the techniques for removing color on commandlinefu.com did not work. I tried replacing the `-r` switch (non- existent on OS X) with `-e`, but that didn't help. Is there some reliable way I can remove color formatting codes on OS X? Here's the command I'm running that needs color output stripped:               for concurrency in $(seq 1 50); do siege -f urls.txt -c $concurrency -t 5m >> results.csv ; done      and here's an example of trying to use `sed` to strip the color from the CSV output:               for concurrency in $(seq 1 50); do siege -f urls.txt -c $concurrency -t 5m | sed "s,\x1B\[[0-9;]*[a-zA-Z],,g" >> results.csv ; done


Mounting and modifying a loopback file without sudo/root, is it possible?

I'm trying to adapt a tutorial into an easy to use script http://qt- project.org/wiki/RaspberryPi_Beginners_guide. I'm trying to reduce the need for sudo/root as much as possible (preferably, only for the final `dd` step). My questions are:   1. Can I mount the ext4 file system without sudo/root privileges in any way?   2. Can I mount it in a way so that users/groups on the FS are ignored in some way (so I can run make install without sudo)? The Filesystem is currently mounted loopback from an offset of a file (i.e. `-o loop,offset=62914560`). This file is the image that will be copied onto the SD card used to boot the Raspberry Pi.


Trying to kill cron job processes found by "ps ax | grep keyword" logged in as pi user

I'm trying to kill several processes from the command line logged into the pi as the user pi. All of the processes have been started by cronjobs, so they should belong to the root user. I'm running the current raspbian. running **ps ax | grep keyword** results in a long list with pairs like this               23157 ?        Ss     0:00 /bin/sh -c python /home/pi/scripting/keyword_script.py     23162 ?        S      0:00 python /home/pi/scripting/keyword_script.py /home/pi/s      I'm looking for the right syntax to kill these, preferably in one command. If that's not possible, I could also try killing them manually one-by-one. I tried for the one-by-one approach: **kill -9 23157** (Error: -bash: kill: (17617) operation not permitted) **sudo kill -9 23157** (long wait, then error sudo: kill: command not found) I tried for the kill-all approach: **pkill -9 keyword** (no error, no kill) **sudo pkill -9 keyword** (no error, no kill) Any hints?


How to run new background command sequentially if I already have a nohup background command running?

Say I already have a background running command1               nohup command1 &      Now I want to submit command2 into background, But I don't want command2 to run immediately. I want command2 to start running after command1 is finished. How can I achieve this?


Where do find information about xkb_symbols (i.e. dead_acute, KP_1, Delete, Down)

Where can I find a list of the **xkb_symbols** and their meaning? To clarify let me give some examples for **xkb_symbols** :   * `dead_acute`   * `dollar`   * `Down`   * `Delete`   * `adiaeresis`   * `Adiaeresis`   * `dead_circumflex`   * `KP_0` _(`KP_` being likely a prefix for "number pad" symbols)_   * `KP_divide`   * .... (many more) Reading this Arch Wiki, I understand that **xkb_symbols** are actually numbers. Those numbers for **xkb_symbols** are assigned to some string representation somewhere ( **This is mainly the question: where?** ). For instance one could look at `/usr/include/X11/keysymdef.h` which among many `#defines` holds the following one:               #define XK_KP_0                          0xffb0       While at least there I can find `XK_KP_0`, which seems to resample `KP_0` (being simple once again prefixed), I still have no information about all the other symbols like (i.e. `dead_circumflex`, `dollar`, etc...).   I would need such a list of defined string representations for example to create, adjust or modify a keyboard layout. Of course I could derive some insight from looking at pre-existing keyboard layout files, but there needs to be a reference to it. I would hence ask here for someone to point me to it. ### more background In the files, which used to define, adjust and modify keyboard layouts located here `/usr/share/X11/xkb/symbols/`, like for example the `de` (German) keyboard layouts `/usr/share/X11/xkb/symbols/de` the **xkb_symbols** are heavily used. In principle this is how such a file looks like (taking the a part of the `de` file):               // based on a keyboard map from an 'xkb/symbols/de' file          default     xkb_symbols "basic" {              include "latin(type4)"              name[Group1]="German";              key   { [         2,   quotedbl,  twosuperior,    oneeighth ] };         key   { [         3,    section, threesuperior,    sterling ] };         key   { [         4,     dollar,   onequarter,     currency ] };         ....         ....     };      I would like to know a list of of xkb_symbols like `quotedbl`, `twosuperior` used in the snippet above.


Mutt and maildir format

I am trying to set up `mutt` to use `maildir` format. I have the following in my `.muttrc` file:               set mbox_type=Maildir     set folder="~/.mail/"     set mbox="~/.mail/"     set spoolfile="~/.mail/"     set record="~/.mail/sent"     set postponed="~/.mail/drafts"      In my `~/.mail/` folder, I have the subfolders `cur new sent tmp`. So far so good. But instead of storing the sent mails in `~/.mail/sent/` mutt creates again the subfolder structures `~/.mail/sent/{cur,new,tmp}`. And stores all sent mails in `~/.mail/sent/cur/`. I find this confusing. is there any reason why this is so?


How to use wc and piping to find how many files and directories are in a certain directory?

How can I use word counter and piping to count how many files or directories are in `/usr/bin` directory?