How can I use my own snippets by using yasnippet in Emacs?

I installed yasnippet and it works fine with default snippets.But I can't add my own snippets. To expand a string `php` to `<?php ?>`, I've done like this. I wrote in my init file like this.               (require 'yasnippet)     (setq yas-snippet-dirs           '("~/.emacs.d/snippets"             "~/.emacs.d/site-lisp/yasnippet/snippets"             ))     (yas-global-mode 1)      I created `~/.emacs.d/snippets/web-mode/php.yasnippet` and wrote               # -*- mode: snippet -*-     # name: php tag     # --     <?php $1 ?>      and call function `yas-reload-all`. But I can't expand the string `php` in the web-mode. What am I doing wrong? What should I do something else?


How to send a file using xmodem protocol from the command line

Want to shell script this and my scripting skills are rather limited so please bear with me. Have scope attached to RX and TX lines of the serial port. If I do:               cat /dev/ttyS0      Get a steady stream of 'C' characters so the remote side is up and sending. If I do:               cat {filename} > /dev/ttyS0      I get a burst on TX line w/o any protocol. If I do the following:               /usr/bin/sx -vv -k -X -b -c send {filename}      TX line remains inactive. File is binary and expecting xmodem 1K protocol. What am I doing wrong? Nevermind. Apparently the magic is:               hello.uart1_divisor_change.xmodem.hex.no_pll0 > /dev/ttyS0 < /dev/ttyS0


Samba 3 on Arch Linux, streams_xattr behaviour

I'm running Samba 3.6.8-1 on my x64 Arch Linux installation. I recently decided to have my samba share support NTFS's Alternate Data Streams by using `streams_xattr` or `streams_depot`. With `streams_xattr` I discovered that if I copy a file having an ADS from a Win7 box to my samba share, on the Linux console I can see the ADS as an `xattr` attached to the file. However when I copy the file back to my Win7 box using Windows Explorer, there are no ADS entries on it. This is not true if I use `streams_depot`. Looking at Wireshark captured network traffic I see that in response to QUERY_FILE_INFO (Query File Stream Info), Samba does not return all streams associated with the file. The response consists of only one stream, which is the file data. Does anyone know what might be going on here? PS: On a side not, when I first enabled `streams_xattr` (true about `streams_depot` too), I was getting an `NT_STATUS_NETWORK_BUSY` from smbd which was also causing Windows to report an 'unexpected error'. Upon some research I found this: https://bugzilla.samba.org/show_bug.cgi?id=7537 . Upon disableing kernel oplocks, this error was gone. I'm wondering if I could still have the kernel oplocks on and there's another way to solve it, since that bug is 2 years old. UPDATE - I've a Macbook Pro running OS X Lion (10.7) with Windows filesharing turned on, and I see the same behavior on that too! .. apparently it uses Samba too


String replacement in file

I have the following file:               <?xml version="1.0" encoding="utf-8"?>     <!--Generated by crowdin.net-->       <string name="test" >- test</string>       <string name="test" >test-test</string>       <string name="test" >test - test</string>      and I would like to replace the `en dash` with its unicode value, but not all of them, just the one in the `string` tag I run several `sed` with different regex, but I couldn't figured it out. One of those was               sed -i.bak "s/-[^-\<\>0-9]/\&#8211\;/g" strings.xml      the output was:               <?xml version="1.0" encoding="utf-8"?>     <!-–enerated by-->       <string name="test" >–test</string>       <string name="test2" >test–est</string>       <string name="test3" >test –test</string>      my problem is that is also replacing _empty spaces_ and the _first char_ of the second word. I have not that big experience with `regex` and `sed`. Could you please explain me what I am doing wrong? Note: I'm using OSX.


Networksetup, how do I make an IF loop for error on connection?

I'm attempting to connect to a network in Mac OSX with this command: networksetup -setairportnetwork eno "NETWORK_NAME" and can most often connect to the network. But I need to make an IF loop for when the network connection fails for some reason. Can anyone help me with that please? Don't know what responses I get from that command or how to use them.. Thanks!


How to get rid of the “scanning for btrfs file systems” at start-up?

After upgrading from Ubuntu 12.04 to Ubuntu 12.10, I get a message "scanning for btrfs file systems" at starting-up. I don't have any BTRFS filesystem. It delays the booting for about 15 seconds. How can I get rid of this?


How can I have new ~/.vnc/xtartup files be configured for normal desktop by default?

When a user first runs `vncserver`, the following `~/.vnc/xstartup` file gets created:               #!/bin/sh          # Uncomment the following two lines for normal desktop:     # unset SESSION_MANAGER     # exec /etc/X11/xinit/xinitrc          [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup     [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources     xsetroot -solid grey     vncconfig -iconic &     xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &     twm &      I want to modify the default file so that the following lines are uncommented:               unset SESSION_MANAGER     exec /etc/X11/xinit/xinitrc      How should I go about this?


What is a good example of a bash script to study in order to learn good coding conventions?

I've learnt the basics of programming in bash. I'd like to study a few examples of bash scripts so that I can learn good habits for bash scripting. In particular, I'm interested in examples of bash scripts that show:   * how to process arguments and trigger conditional functionality   * how to check for input errors   * how to perform command completion   * how to organise a bash script into functions, commands, and so forth   * how to present help messages For example, I learnt a lot from autorandr on github. Are there any other such scripts or script repositories where I could learn about bash scripting conventions?


what is 'nogroup' group's purpose

When I list al groups I see one called 'nogroup'. What is this for? Is it supposed to be least privileged one or something? I'm using ubuntu 11.04.


Bulk rename and resize with Imagemagick

I need to convert a very large number of images that are called 1a.jpg, 2a.jpg, 3a.jpg using Imagemagick to be processed and renamed 1.jpg, 2.jpg, 3.jpg (in the same directory). The Imagemagick command is this, where n is the 1, 2, 3... etc.               convert -shave 200x200 -resize 30% na.jpg n.jpg      Please help with a script.


typeset -A is giving error in script

I was using associative arrays in my script, hence I used to declare them by the `typeset -A <array_name>` command, and it worked fine in the bash prompt But when I use it in my script, I get the following error ` typeset: -A: invalid option typeset: usage: typeset [-afFirtx] [-p] name[=value] ...` An alternative solution will also be acceptable for me. SIDENOTE: I tried typeset -a but it declares an indexed array. But I want an associative array.


How to make front audio jack work again after waking up from suspend?

Sometimes, after I wake up from suspend (using pm-suspend), the front audio jack stops working (no sound) after I wake up my laptop. Only after a full reboot I get it to work again. My laptop is an HP dv6-2030sd and has an Intel sound card. The module loaded is snd_hda_intel, but removing it and adding it again has no effect. I use the ALSA sound system only, so no pulseaudio. My question is, is there a way to get it to work again without a full reboot?


How do I enable locate and queue the database to be built?

On a new Ubuntu 10.4 instance, I tried to use the `locate` command only to receive the error               locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory      from using this command on other systems I'm guessing that this means the database has not yet been built (it is a fresh install). I believe it is supposed to run daily, but how would I queue it up to run immediately? Also, how is "run daily" determined? If I have a box that I only turn on for an hour at a time will the database ever be built on it's own?


kernel: "echo 0 > /proc/sys/kernel/hung_task_timeout_secs"

I got this errors in syslog. Any idea what does it mean? The system is running on Ubuntu 12.04, kernel: `3.8.0-35-generic #52~precise1` It looks to me like failure when trying to write to disk...                [151850.317166] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.      [151850.318428]  ffff8803640f5be8 0000000000000082 0000000034c733da ffff88040e233ec0      [151850.318444]  ffff880408149740 ffff880403c6c5c0 0000000000000001 ffff8803edae80a8      [151850.318468]  [<ffffffff816f41c9>] schedule+0x29/0x70      [151850.318481]  [<ffffffff816f30b7>] __mutex_lock_slowpath+0xd7/0x150      [151850.318497]  [<ffffffff816f2cca>] mutex_lock+0x2a/0x50      [151850.318510]  [<ffffffff811aa006>] path_lookupat+0x236/0x7a0      [151850.318523]  [<ffffffff811aade0>] ? getname_flags.part.31+0x30/0x150      [151850.318537]  [<ffffffff811aaf6e>] ? getname_flags+0x6e/0x80      [151850.318552]  [<ffffffff813141f4>] ? apparmor_inode_getattr+0x54/0x60      [151850.318565]  [<ffffffff811bb929>] ? mntput_no_expire+0x49/0x160      [151850.318578]  [<ffffffff811ab711>] user_path_at+0x11/0x20      [151850.318588]  [<ffffffff811a0c3e>] vfs_lstat+0x1e/0x20      [151850.318602]  [<ffffffff816fdf5d>] system_call_fastpath+0x1a/0x1f      [151850.319634] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.      [151850.376552]  [<ffffffff816f41c9>] schedule+0x29/0x70      [151850.376565]  [<ffffffff816f30b7>] __mutex_lock_slowpath+0xd7/0x150      [151850.376579]  [<ffffffff816f2cca>] mutex_lock+0x2a/0x50      [151850.376590]  [<ffffffff811aa006>] path_lookupat+0x236/0x7a0      [151850.376602]  [<ffffffff811aade0>] ? getname_flags.part.31+0x30/0x150      [151850.376616]  [<ffffffff811aaf6e>] ? getname_flags+0x6e/0x80      [151850.376680]  [<ffffffff813141f4>] ? apparmor_inode_getattr+0x54/0x60      [151850.376691]  [<ffffffff811bb929>] ? mntput_no_expire+0x49/0x160      [151850.376704]  [<ffffffff811ab711>] user_path_at+0x11/0x20      [151850.406554] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.      [151850.465132] sftp-server     D ffff880403bfdf60     0 15199      1 0x00000000      [151850.465158]  ffff8803d2c87fd8 ffff8803d2c87fd8 ffff8803d2c87fd8 0000000000013ec0      [151850.465173]  ffffffff81c15440 ffff88040583ae80 0000000000000001 ffff8803edae80a8      [151850.465263]  [<ffffffff811aa006>] path_lookupat+0x236/0x7a0      [151850.465269]  [<ffffffff81186441>] ? kmem_cache_alloc+0x31/0x140      [151850.465275]  [<ffffffff811aade0>] ? getname_flags.part.31+0x30/0x150      [151850.465283]  [<ffffffff811aa5a4>] filename_lookup+0x34/0xc0      [151850.465289]  [<ffffffff811aaf6e>] ? getname_flags+0x6e/0x80      [151850.465296]  [<ffffffff811ab6b9>] user_path_at_empty+0x59/0xa0      [151850.465303]  [<ffffffff813141f4>] ? apparmor_inode_getattr+0x54/0x60      [151850.465309]  [<ffffffff81087e9a>] ? lg_local_unlock+0x1a/0x20      [151850.465315]  [<ffffffff811bb929>] ? mntput_no_expire+0x49/0x160      [151850.465320]  [<ffffffff811a0946>] ? cp_new_stat+0x116/0x130      [151850.465327]  [<ffffffff811ab711>] user_path_at+0x11/0x20      [151850.465332]  [<ffffffff811a0bc1>] vfs_fstatat+0x51/0xb0      [151850.465337]  [<ffffffff811a0c3e>] vfs_lstat+0x1e/0x20      [151850.465343]  [<ffffffff811a0dea>] sys_newlstat+0x1a/0x40      [151850.465350]  [<ffffffff816fdf5d>] system_call_fastpath+0x1a/0x1f


What happened with my SHLVL?

I was messing around with my bashrc, finding better ways to start a newer version of `bash`. Never mind my tests. But this strange thing happened, which I like to understand:               $ bash  ## Probably where the infinite recursion happened             ## terminated by too many access to .bashrc and derived files     $ echo $BASH_VERSION      4.2.0(1)-release     $ echo $SHLVL      362     $ exit     $ echo $SHLVL      2      I think a end up with a infinite recursion (that is already fixed), but how can the shell level go from 362 to 2 with a single `Ctrl`+`D` (produces the `exit`)?


List of special characters in the shell

I am not sure what they are called, but where could I find a list of wild cards? I see things like:   * `$f`   * `%s`   * `$1` Is there a definitive list for what each one represents?


Battery meter only appears when laptop gets plugged in

The battery meter refuses to show unless I plug the laptop in. If I remove the applet and then re-add it it still won't show. I am using Mint 17 and here is the screen shot of my Power settings and I don't have any battery status option in it: ![enter image description here](http://i.stack.imgur.com/5Tltu.png) Any Ideas?


How can I have activity in a Dropbox folder logged?

I have a folder shared with others through Dropbox. When a file is added to this folder, I get a system tray notification in KDE --- but of course if I'm not at my computer, I wouldn't see the notification. Is there a way to automatically log any changes within a folder (especially file creation), and/or automatically run a bash script to, say, send an email to myself as a more durable "alert"? A google search turned up incron ... It sounds about right. Has anyone used this software?


how to get IP from DHCP in network in redhat which is installed on VMware

I'm running Red Hat inside a VMware image (on a Windows XP machine). I want to connect the Red Hat VM to our network; do I need to configure something inside VMware or inside Red Hat? I don't have any IPs set to connect to the internet


Problematic build script with quotes

Hi I'm trying to create a build script that executes these commands:               cd libiconv     ../../src/libiconv/configure --prefix=/home/ruben/mingw64/build/gcc-libs \                                  --host=x86_64-w64-mingw32 --build=x86_64-w64-mingw32 \                                  CFLAGS="-mtune=core2 -flto -fomit-frame-pointer -momit-leaf-frame-pointer" LFLAGS="-flto -fwhopr=2"     make -j3 -s     make -s install     cd ..      It looks like this:               #!/bin/sh     HOST=x86_64-w64-mingw32     TARGET=x86_64-w64-mingw32     BUILD=x86_64-w64_mingw32     # options     BUILD_CORES=2 #used as argument for "make -j#"     # directories: SRC_DIR contains full source package.     GCC_LIBS_DIR=$BUILD_DIR/gcc-libs          # optimized for my system.     BUILD_CFLAGS="\"-mtune=core2 -flto -fomit-frame-pointer -momit-leaf-frame-pointer\""     BUILD_LFLAGS="\"-flto -fwhopr="${BUILD_CORES}"\""     CONFIG_OPTS="--prefix="${PREFIX}" --host="${HOST}" --build="${BUILD}" CFLAGS="${BUILD_CFLAGS}" LFLAGS="${BUILD_LFLAGS}       makeopts="-s -j"${BUILD_CORES}          # libiconv     cd libiconv     echo "configuring libiconv: "${CONFIG_OPTS}     ../../src/libiconv/configure "${CONFIG_OPTS}" > configure.log || exit 1     echo "building libiconv"     make $MAKEOPTS > build.log || exit 1     echo "installing libiconv"     make -s install > install.log || exit 1     cd ..      The thing is, the echo command shows the exact configure command I want, but when running configure it doesn't so the right thing. Something goes terribly wrong, after `CFLAGS=-mtunecore2`, when configure tries to use -flto (which is quoted!!) as an argument. What am I doing wrong? Thanks! PS: I'm running MSYS, not _real_ *nix...


How to make vertical bar | work in grep?

Here's an example of a grep command line I've tried:               grep '(565172|565173|565175)' /var/log/cups/error_log      It doesn't produce any output, even though all 3 values are in the file multiple times. I tried escaping the bars, and that improved things somewhat - the middle value was detected but not the first or last.               grep '(565172\|565173\|565175)' /var/log/cups/error_log      I also tried double escapes and went back to getting no results.               grep '(565172\\|565173\\|565175)' /var/log/cups/error_log      What am I doing wrong? Thanks.


How to combine dmix with ladspa plugins to default device

A while I have abandoned all sound daemons and lived happily ever since with just the dmix plugin. However, recently I got annoyed by the different volume levels of youtube videos and decided to plug in a compressor and a limiter. IMHO this is an extremely desirable setup. But alas, I had no luck. I got playback to work or capture, but never both. I suppose the underlying problem is my lack of understanding, so my fundamental questions are:   * Where can I find a good documentation of alsa and .asoundrc, which goes beyond mere examples and which would e.g. explain the error messages (see below) I got.   * Has anyobody succeeded in a daemonless sound setup which included ladspa plugins?   * Does anybody know the reasons, or even a solution for my particular problems (described below)? * * * For those of you who have the patience to follow my woes here they are. I got as far as being able to play sound like this               aplay -D ladspaChain /usr/share/skype/sounds/CallBusy.wav      but I cannot play via the default device.                pcm.!default {         type plug         slave.pcm {         type asym         playback.pcm "ladspaChain"         capture.pcm "dsnooper"        }     }      Without -D ladspaChain, I get               aplay: pcm_params.c:170: snd1_pcm_hw_param_get_min: Assertion `!snd_interval_empty(i)' failed.**      Alternatively I tried                pcm.!default {         type route         slave.pcm {         type asym         playback.pcm "ladspaChain"         capture.pcm "dsnooper"        }         ttable {             0.0     1       # left channel             1.1     1       # right channel         }      }       In this case playback works, but arecord gives me               arecord: set_params:1081: Sample format non available     Available formats:     - S32_LE


Error running Virtual Box on Arch Linux

I installed Virtual Box regularly on Arch Linux using pacman:               pacman -S virtualbox      When i run `virtualbox` from the terminal, the GUI of the program is loaded but I can't use a virtual machine and I get this warning:               The vboxdrv kernel module is not loaded. Either there is no module              available for the current kernel (3.12.5-1-ARCH) or it failed to              load. Please reinstall the kernel module virtualbox-host-modules or              if you don't use our stock kernel compile the modules with                     sudo dkms autoinstall      How to solve the problem?


How can I list the available color names?

I'm trying to add some color to my git configuration and I want to know what color names are available on the terminal.   * I only want to use colors by name so it's easier for others to understand   * I don't want to add any new colors - I just want to select from the predefined names   * I would like a solution that works for all distros, but primarily Debian   * It would be nice to see the color that the name indicates Many online references often talk about color names that are not defined on my system, so I just need a way to see what my default options are.


Convert linux symlink to osx symlink

I have transferred a folder from a linux machine to a macbook pro with osx 10.9, now I am having trouble with the symlinks in this folder (lots of them). In linux if I do `vi link2file.txt`, it has the same effect as `vi file.txt`, but in osx, it shows something like this:               IntxLNKh�t�m�l�_�t�e�x�.�s�n�i�p�      Why is this happening and is there a fast method to fix this? To recreate all the symlinks by hand would be a PITA.


show colors and disable line wrap

Using the `less` paginator, you can use the `-r` option to properly display colored input and the `-S` option to disable line wrap. However, when using `less -rS` or equivalently `less -r -S`, colors are diplayed but lines are wrapped. How can this be achieved?


Local, timestamped logging of all ssh commands?

How can I keep a local, timestamped record of all remote commands I use in `ssh` (command-line openssh client started through `bash`)? **Requirements:**   * _Essential:_     * 100% client-side without relying on server logging     * Configured or installed per-user with logs stored in the user's home directory.     * Support for distinguishing between multiple simultaneous sessions with various users and hosts.     * Non-intrusive (no need to activate it each time and does not interfere significantly with using ssh)   * _High priority:_     * Either output is not logged or filtered out as much as possible     * Either password entries are not logged or the file is encrypted     * Indicates the actual commands used (after tab/ history completion, backspaces, `CTRL`+`C`, etc... have been processed)   * _Nice to have:_     * Also logs commands in chained sessions (commands entered during remote `ssh` or `su <user>` sessions)     * Session start and end should be logged     * A simple `bash`-based, non-root solution would be best (perhaps an `alias` or `bash` wrapper script for the `ssh` command?) **My skill level:**   * I am not new to programming, but am still learning `bash` and the "Linux way", so code samples with brief explanations would be most appreciated. **Possible strategies**   * _keylogger_ -- Problem: logs passwords, does not log tab/ history completion (see glenn's answer)   * _`screen` with scrollback dumping once per second and `diff` between them to find new scrollback lines_ -- Problem: how can this be implemented in an useful automated way?   * `ssh "$@" | tee >(some_cleaner_function >> $logfile)` -- Problem: cannot handle multiline commands or history in chained sessions, careful cleanup needed (see my answer)   * A combination of some of the above **An example** The following SSH session:               user@local:~$ ssh user@remote     Last login: Tue Jun 17 16:34:23 2014 from local     user@remote:~$ cd test     user@remote:~/test$ ls     a  b     user@remote:~/test$ exit      Might result in a log at `~/logs/ssh.log` such as:               2014-06-17 16:34:50   [user@remote - start]     2014-06-17 16:34:51   [user@remote] cd test     2014-06-17 16:34:52   [user@remote] ls     2014-06-17 16:34:53   [user@remote] exit     2014-06-17 16:34:53   [user@remote - end]      Or, perhaps a separate log will be created for each session with the command line used to start the session at the top of the file.


Delete a block of lines with a condition on the last line

I have a log-file where at the end of a series of lines you can see if this block is relevant. Now I'm looking for a command like sed to delete de blocks ending with "Content-Length: 0" and beginning with the last "--" before this line. I tried `sed -n "/--/,/Content-Length: 0/d"` but this takes the first "--" and the first "Content-Length: 0" and deletes it. ex :               line 1 "--"       line 2        line 3 "Content-Length: 20"       line 4 "--"       line 5       line 6 "Content-Length: 0"       i want to delete line 4,5 and 6 not line 1 to 6 how can i do this? The answer to work with `tac` instead of `cat` does the job! but ultimately i would like to use this in a `tail -f` construction


Linux process scheduling - Cap/Weight based?

I am just trying to understand the basics of Linux scheduler.   * Is Linux scheduler a Cap based or weight based scheduler? I was previously using Xen. Now I am moving from Xen to KVM. I read VMs are normal process and thus will follow the scheduling policies of the linux scheduler. I was previously using Xen's credit scheduler which had the capability to set cap/weight for vms. I am searching for equivalent capability and also basic understanding of the linux scheduler. I am using Centos 5.6 . Which still uses 2.6.18. I dont think CFS is present in the kernel I am using.


Does [[:space:]] work for sed patterns on all Linux distros?

Using `[[:space:]]` looks a little non-elegant and, quite frankly, Microsoft- ish for `sed` match patters. I was trying to extract "Last" out of "First Last" and either of the following worked:               echo "First Last" | sed s/First //     echo "First Last" | sed s/First\s//      What did work is               echo "First Last" | sed s/First[[:space:]]//      I was wondering:   1. Is there is a more minimalistic notation to match a whitespace in `sed`?    2. Does `[[:space:]]` work on all Linux distros?


Mount Google Drive in Linux?

Now that Google Drive is available, how do we mount it to a Linux filesystem? Similar solutions exist for Amazon S3 and Rackspace Cloud Files.


Two users, full access to same folder

I have a laptop running Arch Linux, and an owncloud-client. I have an owncloud server on my local network. When outside of my local network, I must use a dyn dns URL to get to my server. When on the local network, any queries to that same URL (Or just the IP address of the network as it appears on the WAN) are terminated (this is a network thing, not my computers). So. I want to have 2 owncloud clients. One for when I'm away, and one when I'm at home. But I want them to sync to the same folder. And I don't want them to require a breach of data security (aka opening my home folder to anybody) to do it. Can I? How?


How do I resize a disk image device?

I'm trying to reduce the size of a backup drive image. Original disk had these partitions:               Model: ST916082 1A (scsi)     Disk /dev/sde: 160GB     Sector size (logical/physical): 512B/512B     Partition Table: msdos          Number  Start   End     Size    Type      File system  Flags      1      32.3kB  65.7GB  65.7GB  primary   ntfs         boot      2      65.7GB  160GB   94.4GB  extended               lba      5      65.7GB  160GB   94.4GB  logical   ntfs      Image was created from the logical partition using the command               > sudo ddrescue /dev/sde5 datapartition logfile          Press Ctrl-C to interrupt     Initial status (read from logfile)     rescued:         0 B,  errsize:       0 B,  errors:       0     Current status     rescued:    94368 MB,  errsize:       0 B,  current rate:   23068 kB/s        ipos:    94368 MB,   errors:       0,    average rate:   28839 kB/s        opos:    94368 MB,     time from last successful read:       0 s     Finished      `ntfsresize -i -f datapartition` says:               ntfsresize v2012.1.15AR.5 (libntfs-3g)     Device name        : datapartition     NTFS volume version: 3.1     Cluster size       : 4096 bytes     Current volume size: 26999992832 bytes (27000 MB)     Current device size: 94368605184 bytes (94369 MB)     Checking filesystem consistency ...     100.00 percent completed     Accounting clusters ...     Space in use       : 26107 MB (96.7%)     Collecting resizing constraints ...     You might resize at 26106810368 bytes or 26107 MB (freeing 893 MB).     Please make a test run using both the -n and -s options before real resizing!      So it looks like I already resized the filesystem to fit the data, but did not resize the device? (This was 2 years ago, I forget.) And I need to resize the device using fdisk, right? But fdisk doesn't recognize the partition:               > fdisk -lu datapartition           Disk datapartition: 94.4 GB, 94368605184 bytes     255 heads, 63 sectors/track, 11472 cylinders, total 184313682 sectors     Units = sectors of 1 * 512 = 512 bytes     Sector size (logical/physical): 512 bytes / 512 bytes     I/O size (minimum/optimal): 512 bytes / 512 bytes     Disk identifier: 0x69205244          This doesn't look like a partition table     Probably you selected the wrong device.                  Device Boot      Start         End      Blocks   Id  System     datapartition1   ?   218129509  1920119918   850995205   72  Unknown     datapartition2   ?   729050177  1273024900   271987362   74  Unknown     datapartition3   ?   168653938   168653938           0   65  Novell Netware 386     datapartition4      2692939776  2692991410       25817+   0  Empty          Partition table entries are not in disk order      nor does cfdisk:               > cfdisk datapartition           FATAL ERROR: Bad primary partition 1: Partition begins after end-of-disk                           Press any key to exit cfdisk      I can mount the partition and copy files off of it, though. How do I resize the device?


Can entropy consumption at program start be prevented?

I use Knoppix (or other Live CDs/DVDs) as a secure environment for creating valuable crypto keys. Unfortunately entropy is a limited resource in such environments. I just noticed that each program start consumes quite some entropy. This seems to be due to some stack protection feature that needs address randomization. Nice feature but completely useless and - worse - destructive in my scenario. Is there any possibility to disable this feature? I would prefer one that allows me to continue using the original Knoppix (or whatever) image and just need some configuration at runtime. I read that this was caused by glibc. I am surprised that an `strace -p $PID -f -e trace=open` against bash does not show any accesses to /dev/random when I start programs. But I am not familiar with the interaction of execve() and the linker.


While setting up SFTP between *nix servers, is the intial handshake optional?

I setup SFTP between *nix servers as follows:   1. Generate the Public key on the sending server by running the below command: `[user1@server1] $ /usr/local/bin/ssh-keygen -t rsa -b 1024`   2. Then copy "id_dsa.pub" file into the `/home/remote_user1/.ssh/authorized_keys` file on the remote machine server2.    3. Connect to server2: `$ sftp remote_user1@server2` I am then prompted to enter the password once to complete the handshake and then for all following SFTP connections it directly connects.. But recently another team was able to directly connect to our server without the initial handshake, generally I need to provide the remote_user1's password for handshaking.. So what configuration changes (if any) may have allowed for the handshake to be done without the password..? Any links that could help me better understand the SFTP handshaking process would be very helpful too, as I couldn't find much on this subject.


How long should I wait between keystrokes when doing SysRq + REISUB?

I read this from here: > The most useful combination is the `Alt`+`SysRq/Prnt Scrn` + R-E-I-S-U-B. > > The above basically means that while you press and hold `Alt`+`SysRq/Prnt > Scrn` and press R, E, I, S, U, B giving sufficient time between each of > these keys to ensure they perform the required job. My question is: How long should I wait to ensure "sufficient time" between each of these keys?


Open-source computer algebra systems for linux

Some years ago I used MuPAD as a free computer algebra system. However since 2005 it's not free anymore. So, are there any good free or even better open- source computer algebra systems for linux coming close to commercial products like mathematica or maple?


GLX extension not working properly with xvfb

I have an Ubuntu 14.04 system with the following packages installed:               libegl1-mesa:amd64     libegl1-mesa-drivers:amd64     libgl1-mesa-dri:amd64     libgl1-mesa-dri:i386     libgl1-mesa-glx:amd64     libgl1-mesa-glx:i386     libglapi-mesa:amd64     libglapi-mesa:i386     libgles2-mesa:amd64     libglu1-mesa:amd64     libopenvg1-mesa:amd64     libwayland-egl1-mesa:amd64     mesa-utils     xvfb      I want to start an application under xvfb. I first start xvfb with:               $ Xvfb :1 -screen 0 1024x768x24 +extension GLX +render -noreset >> xsession.log 2>&1 &      and then check the xvfb log file:               Initializing built-in extension Generic Event Extension     Initializing built-in extension SHAPE     Initializing built-in extension MIT-SHM     Initializing built-in extension XInputExtension     Initializing built-in extension XTEST     Initializing built-in extension BIG-REQUESTS     Initializing built-in extension SYNC     Initializing built-in extension XKEYBOARD     Initializing built-in extension XC-MISC     Initializing built-in extension SECURITY     Initializing built-in extension XINERAMA     Initializing built-in extension XFIXES     Initializing built-in extension RENDER     Initializing built-in extension RANDR     Initializing built-in extension COMPOSITE     Initializing built-in extension DAMAGE     Initializing built-in extension MIT-SCREEN-SAVER     Initializing built-in extension DOUBLE-BUFFER     Initializing built-in extension RECORD     Initializing built-in extension DPMS     Initializing built-in extension Present     Initializing built-in extension DRI3     Initializing built-in extension X-Resource     Initializing built-in extension XVideo     Initializing built-in extension XVideo-MotionCompensation     Initializing built-in extension SELinux     Initializing built-in extension GLX      which shows no errors. Also, it seems that GLX has been loaded properly. Now, if I check the server with               $ glxinfo -display :1      I get               name of display: :1     Xlib:  extension "GLX" missing on display ":1".     ...     Error: couldn't find RGB GLX visual or fbconfig     Xlib:  extension "GLX" missing on display ":1".     ...     Error: couldn't find RGB GLX visual or fbconfig          Xlib:  extension "GLX" missing on display ":1".     ...      In fact, the application that I want to start on this server and that needs GLX won't start. After checking several documentation pages and forums, I have no clue as to what is going wrong here. Why does the X server log file not show any errors if the GLX extension was not loaded correctly? Is there something I should check?


tail -f but suck in content of the file first (aka `cat -f`)

I need to display whole file before tracking it for a new changes, not only the last 10 lines (yep, I know it's not _tail_ conceptually). In other words, something like `cat -f` would do, if it would ever existed. Tail's man doesn't give me any ideas. The only option I see right now is to somehow combine _cat all but last 10 lines_ and _tail -f_ output. Any hints, please?


screenrc: find out the keys bound by bindkey

The bindkey keyword in .screenrc is preceded by some cryptic keys that correspond to some keybouard binding. How can I figure out what these are? Google and GNU Screen Documentation did not show the results I was looking for.   For example, how would you found the bindings below without someone specifically telling you what the binding is?   `bindkey "^[[1;5I" next`   `bindkey "^[[1;6I" prev`


operation in /dev/shm causes overflow

I am repeating tens of thousands of similar operations in /dev/shm, each with a directory created, files written, and then removed. My assumption used to be that I was actually creating directories and removing them in place, so the memory consumption had to be quite low. However it turned out the usage was rather high, and finally caused memory overflow. So my questions is: with operations like               mkdir /dev/shm/foo     touch /dev/shm/foo/bar     [edit] /dev/shm/foo/bar     ....     rm -rf /dev/shm/foo      Will it finally cause memory overflow? and if it does, why is that, since it seems to be removing them in-place. **Note:** this is a tens of thousands similar operation.


Cannot succesfully run apt-get -f install

I am working on a Ubuntu `Ubuntu 12.04.2 LTS (GNU/Linux 3.5.0-43-generic x86_64)` machine. There are some packages that I need to install, and in order to be able to that, first I have to run `apt-get -f install`. But this is what I get when I run `apt-get -f install`:               root@SERVERLINUX:/boot# apt-get -f install     Reading package lists... Done     Building dependency tree            Reading state information... Done     Correcting dependencies... Done     The following packages were automatically installed and are no longer required:       firefox-globalmenu python2.6-minimal linux-headers-3.5.0-39-generic linux-headers-3.5.0-34 linux-headers-3.5.0-37       linux-headers-3.5.0-39 thunderbird-globalmenu linux-headers-3.5.0-34-generic linux-headers-3.5.0-37-generic     Use 'apt-get autoremove' to remove them.     The following extra packages will be installed:       linux-image-generic-lts-quantal     The following packages will be upgraded:       linux-image-generic-lts-quantal     1 upgraded, 0 newly installed, 0 to remove and 440 not upgraded.     2 not fully installed or removed.     Need to get 0 B/2.442 B of archives.     After this operation, 0 B of additional disk space will be used.     Do you want to continue [Y/n]? Y     dpkg: dependency problems prevent configuration of linux-image-generic-lts-quantal:      linux-image-generic-lts-quantal depends on linux-image-3.5.0-44-generic; however:       Package linux-image-3.5.0-44-generic is not installed.     dpkg: error processing linux-image-generic-lts-quantal (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of linux-generic-lts-quantal:      linux-generic-lts-quantal depends on linux-image-generic-lts-quantal; however:       Package linux-image-generic-lts-quantal is not configured yet.     No apport report written because the error message indicates its a followup error from a previous failure.                                                                                No apport report written because the error message indicates its a followup error from a previous failure.                                                                                dpkg: error processing linux-generic-lts-quantal (--configure):      dependency problems - leaving unconfigured     Errors were encountered while processing:      linux-image-generic-lts-quantal      linux-generic-lts-quantal     E: Sub-process /usr/bin/dpkg returned an error code (1)      What's going on? How can I manage to run `apt-get -f install` succesfully? How can I solve those dependency errors? EDIT: This is what I get when I run `dpkg --configure -a`, as suggested by Mohsen Pahlevanzadeh:               root@SERVERLINUX:/boot# dpkg --configure -a     dpkg: dependency problems prevent configuration of linux-image-generic-lts-quantal:      linux-image-generic-lts-quantal depends on linux-image-3.5.0-44-generic; however:       Package linux-image-3.5.0-44-generic is not installed.     dpkg: error processing linux-image-generic-lts-quantal (--configure):      dependency problems - leaving unconfigured     dpkg: dependency problems prevent configuration of linux-generic-lts-quantal:      linux-generic-lts-quantal depends on linux-image-generic-lts-quantal; however:       Package linux-image-generic-lts-quantal is not configured yet.     dpkg: error processing linux-generic-lts-quantal (--configure):      dependency problems - leaving unconfigured     Errors were encountered while processing:      linux-image-generic-lts-quantal      linux-generic-lts-quantal      **SOLUTION** : As suggested by Faheem Mitha, I run `apt-get install linux- image-3.5.0-44-generic` and it worked perfectly. Actually it has solved my problem


YouCompleteMe not working after default install

I was trying to install `YouCompleteMe` with `Vundle` and it installed fine (it downloaded the `git` repository I pointed it to). I went into the folder and ran install.sh with the clang semantics and everything seems to work fine except for that I get this error every time I start `Vim` and it attempts to start the `YCM` plugin: > Error detected while processing VimEnter Auto commands for "*": E117: > Unknown function: youcompleteme#Enable In addition to this (if it's helpful) the Helptags section in `PluginInstall` has always thrown an error but it's never affected the execution of the plugins before. The result of `run_tests.sh`:               /tmp/ycm_build.tYz9by ~/.vim/bundle/YouCompleteMe     -- The C compiler identification is GNU 4.8.2     -- The CXX compiler identification is GNU 4.8.2     -- Check for working C compiler: /usr/bin/cc     -- Check for working C compiler: /usr/bin/cc -- works     -- Detecting C compiler ABI info     -- Detecting C compiler ABI info - done     -- Check for working CXX compiler: /usr/bin/c++     -- Check for working CXX compiler: /usr/bin/c++ -- works     -- Detecting CXX compiler ABI info     -- Detecting CXX compiler ABI info - done     Your C++ compiler supports C++11, compiling in that mode.     -- Found PythonLibs: /usr/lib/i386-linux-gnu/libpython2.7.so (found suitable version "2.7.6", minimum required is "2.6")      NOT using libclang, no semantic completion for C/C++/ObjC will be available     -- Found PythonInterp: /usr/bin/python (found version "2.7.6")      -- Looking for include file pthread.h     -- Looking for include file pthread.h - found     -- Looking for pthread_create     -- Looking for pthread_create - not found     -- Looking for pthread_create in pthreads     -- Looking for pthread_create in pthreads - not found     -- Looking for pthread_create in pthread     -- Looking for pthread_create in pthread - found     -- Found Threads: TRUE       -- Configuring done     -- Generating done     -- Build files have been written to: /tmp/ycm_build.tYz9by     Scanning dependencies of target BoostParts     [  0%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/posix_time/posix_time_types.cpp.o     [  1%] [  1%] [  2%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/gregorian_types.cpp.o     Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/date_generators.cpp.o     Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/greg_month.cpp.o     [  3%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/date_time/src/gregorian/greg_weekday.cpp.o     [  4%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/tuple.cpp.o     [  4%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/numeric.cpp.o     [  5%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/errors.cpp.o     [  6%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/dict.cpp.o     [  6%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/str.cpp.o     [  7%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object_protocol.cpp.o     [  9%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/long.cpp.o     [  9%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object_operators.cpp.o     [ 10%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/slice.cpp.o     [ 11%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/list.cpp.o     [ 11%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/exec.cpp.o     [ 12%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/import.cpp.o     [ 13%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/type_id.cpp.o     [ 13%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/registry.cpp.o     [ 14%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/from_python.cpp.o     [ 15%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/arg_to_python_base.cpp.o     [ 15%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/converter/builtin_converters.cpp.o     [ 17%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/function_doc_signature.cpp.o     [ 18%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/stl_iterator.cpp.o     [ 19%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/function.cpp.o     [ 19%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/inheritance.cpp.o     [ 20%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/class.cpp.o     [ 21%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/pickle_support.cpp.o     [ 21%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/enum.cpp.o     [ 22%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/life_support.cpp.o     [ 23%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/object/iterator.cpp.o     [ 23%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/module.cpp.o     [ 25%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/python/src/wrapper.cpp.o     [ 26%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/smart_ptr/src/sp_collector.cpp.o     [ 26%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/smart_ptr/src/sp_debug_hooks.cpp.o     [ 27%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/exception/src/clone_current_exception_non_intrusive.cpp.o     [ 28%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_xml_archive.cpp.o     [ 28%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_serializer_map.cpp.o     [ 29%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/utf8_codecvt_facet.cpp.o     [ 30%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/void_cast.cpp.o     [ 30%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_grammar.cpp.o     [ 31%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_pointer_oserializer.cpp.o     [ 32%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/extended_type_info.cpp.o     [ 32%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/binary_wiarchive.cpp.o     [ 34%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_archive.cpp.o     [ 35%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_text_wiprimitive.cpp.o     [ 35%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/text_iarchive.cpp.o     [ 36%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/text_oarchive.cpp.o     [ 37%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_pointer_iserializer.cpp.o     [ 38%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_iarchive.cpp.o     [ 38%] [ 39%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_iarchive.cpp.o     Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/archive_exception.cpp.o     [ 40%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_oserializer.cpp.o     [ 40%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_text_iprimitive.cpp.o     [ 42%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/shared_ptr_helper.cpp.o     [ 43%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/extended_type_info_typeid.cpp.o     [ 43%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/codecvt_null.cpp.o     [ 44%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_text_oprimitive.cpp.o     [ 45%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_text_woprimitive.cpp.o     [ 45%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/polymorphic_iarchive.cpp.o     [ 46%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/stl_port.cpp.o     [ 47%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/polymorphic_oarchive.cpp.o     [ 47%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_wiarchive.cpp.o     [ 48%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/extended_type_info_no_rtti.cpp.o     [ 50%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_woarchive.cpp.o     [ 50%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/binary_iarchive.cpp.o     [ 51%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/text_wiarchive.cpp.o     [ 52%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/text_woarchive.cpp.o     [ 52%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/binary_oarchive.cpp.o     [ 53%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_wgrammar.cpp.o     [ 54%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_oarchive.cpp.o     [ 54%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_archive_exception.cpp.o     [ 55%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/xml_oarchive.cpp.o     [ 56%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/binary_woarchive.cpp.o     [ 57%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/serialization/src/basic_iserializer.cpp.o     [ 57%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/atomic/src/lockpool.cpp.o     [ 59%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/system/src/error_code.cpp.o     [ 60%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/utf8_codecvt_facet.cpp.o     [ 60%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/path_traits.cpp.o     [ 61%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/portability.cpp.o     [ 62%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/operations.cpp.o     [ 62%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/codecvt_error_category.cpp.o     [ 63%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/unique_path.cpp.o     [ 64%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/path.cpp.o     [ 64%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/filesystem/src/windows_file_codecvt.cpp.o     [ 65%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex.cpp.o     [ 67%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/wide_posix_api.cpp.o     [ 67%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/posix_api.cpp.o     [ 68%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/c_regex_traits.cpp.o     [ 69%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/w32_regex_traits.cpp.o     [ 69%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/instances.cpp.o     [ 70%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex_traits_defaults.cpp.o     [ 71%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex_raw_buffer.cpp.o     [ 71%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/icu.cpp.o     [ 72%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/cregex.cpp.o     [ 73%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/static_mutex.cpp.o     [ 73%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/usinstances.cpp.o     [ 75%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/wc_regex_traits.cpp.o     [ 76%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/regex_debug.cpp.o     [ 77%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/cpp_regex_traits.cpp.o     [ 77%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/winstances.cpp.o     [ 78%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/regex/src/fileiter.cpp.o     [ 79%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/thread/src/future.cpp.o     [ 79%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/thread/src/pthread/once.cpp.o     [ 80%] Building CXX object BoostParts/CMakeFiles/BoostParts.dir/libs/thread/src/pthread/thread.cpp.o     Linking CXX static library libBoostParts.a     [ 80%] Built target BoostParts     Scanning dependencies of target ycm_client_support     Scanning dependencies of target ycm_core     [ 81%] [ 81%] [ 81%] [ 82%] Building CXX object ycm/CMakeFiles/ycm_core.dir/versioning.cpp.o     Building CXX object ycm/CMakeFiles/ycm_core.dir/Result.cpp.o     Building CXX object ycm/CMakeFiles/ycm_client_support.dir/Result.cpp.o     Building CXX object ycm/CMakeFiles/ycm_client_support.dir/versioning.cpp.o     [ 84%] [ 85%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierUtils.cpp.o     Building CXX object ycm/CMakeFiles/ycm_client_support.dir/IdentifierUtils.cpp.o     [ 85%] Building CXX object ycm/CMakeFiles/ycm_core.dir/LetterNode.cpp.o     [ 85%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/LetterNode.cpp.o     [ 86%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierDatabase.cpp.o     [ 87%] Building CXX object ycm/CMakeFiles/ycm_core.dir/IdentifierCompleter.cpp.o     [ 87%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CandidateRepository.cpp.o     [ 88%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/IdentifierDatabase.cpp.o     [ 89%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Utils.cpp.o     [ 90%] Building CXX object ycm/CMakeFiles/ycm_core.dir/ycm_core.cpp.o     [ 90%] Building CXX object ycm/CMakeFiles/ycm_core.dir/LetterNodeListMap.cpp.o     [ 92%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/IdentifierCompleter.cpp.o     [ 93%] Building CXX object ycm/CMakeFiles/ycm_core.dir/CustomAssert.cpp.o     [ 94%] Building CXX object ycm/CMakeFiles/ycm_core.dir/Candidate.cpp.o     [ 94%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/CandidateRepository.cpp.o     [ 94%] Building CXX object ycm/CMakeFiles/ycm_core.dir/PythonSupport.cpp.o     [ 95%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/Utils.cpp.o     [ 96%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/ycm_client_support.cpp.o     [ 96%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/LetterNodeListMap.cpp.o     [ 97%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/CustomAssert.cpp.o     [ 98%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/Candidate.cpp.o     [100%] Building CXX object ycm/CMakeFiles/ycm_client_support.dir/PythonSupport.cpp.o     Linking CXX shared library /home/josh/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_core.so     [100%] Built target ycm_core     Linking CXX shared library /home/josh/.vim/bundle/YouCompleteMe/third_party/ycmd/ycm_client_support.so     [100%] Built target ycm_client_support     Scanning dependencies of target ycm_support_libs     [100%] Built target ycm_support_libs     ~/.vim/bundle/YouCompleteMe     ./run_tests.sh: line 9: flake8: command not found


Who does the linewrap and how to deactivate?

If I connect to a linux device via serial adapter (no matter if pyserial, screen or minicom), and no matter how I change settings like `stty` when I enter a long command it gets line wrapped (specifically a space and a carriage return is entered). My knowledge in this area is so small that I couldn't even call myself a beginner, but is it possible that the tool which reads lines or the shell interpreter is wrapping the lines? Again, changing `stty`'s size to `60 100` didn't change the point where the line wrap happened at all. Shell information:               root@4020-1-00007:~# echo $SHELL     /bin/sh     root@4020-1-00007:~# ls -al /bin/sh      lrwxrwxrwx    1 root     root             9 Jul 31 18:09 /bin/sh -> /bin/bash     root@4020-1-00007:~# bash --version     GNU bash, version 4.3.0(1)-release (arm-angstrom-linux-gnueabi)     Copyright (C) 2013 Free Software Foundation, Inc.     License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>          This is free software; you are free to change and redistribute it.     There is NO WARRANTY, to the extent permitted by law.      (no idea how I find out which build options were chosen)


optirun and ssh -X

I would like to run a remote OpenGL program through `ssh` tunneled with the `-X` option. My laptop has Optimus so anything using OpenGL has to go through `optirun` (`bumblebee`). This would explain why I can't launch the program (`vmd` in my case, it says `can't open OpenGl GLX`). Is there a way around?


Problem after installing Compiz on Arch+XFCE4

I have installed `compiz-bzr` and `emerald-git` by following commands :               yaourt -S compiz-bzr     yaourt -S emerald-git      And then I have tried :               emerald --replace      And now all windows are without borders. docky's animation does not work any more. and many other problems... Please tell me what am I doing wrong? Any helps would be awesome.


gzip, bzip2 and zip: very low compression ratio

I need to transfer (via ftp) some movie files (.MPG) on to remote machine. I thought to 1st compress it and then send. But all the compression utilities (gzip, bzip2 and zip) are having very less compression ratio. For example:               ravbholua@ravbholua-Aspire-5315:~/Desktop/MAIL/SNEHAMILAN$ gzip -l MOV04042.MPG.gz              compressed        uncompressed  ratio uncompressed_name                61949207            66970629   7.5% MOV04042.MPG     ravbholua@ravbholua-Aspire-5315:~/Desktop/MAIL/SNEHAMILAN$      As you see here, so less compression. Same is the case with bzip2 and zip. Please suggest any better compression utility so that I can compress 400 MB movie files to a good extent and then ftp it. What I w'd do is: 1st I w'd tar all the movie files and then compress it to ftp on remote machine.


Error with Class locale with gcc 2.96

I am using Red Hat Linux release 9 Kernel 2.4.20-8 on an i686 with gcc version 2.96. In my code I am declaring like,               std::locale utf8_locale;      I am getting this error:               syntax error before `;'      Please suggest me with a solution.


How do I install emacs 24.3 on Fedora 17 using yum?

I already have emacs 24.1.1, but I need to use version 24.3. I tried:               sudo yum install emacs24.3      but it is not recognized. Is there a way to upgrade my emacs or should I simply install emacs 24.3? I also tried:               yum search emacs      but I could not find any related packages to emacs 24.3. I am using Fedora 17 (generic) on a VM. BTW I am a bit new to Fedora, but familiar with Debian (particularly Ubuntu). **Update** Here are my Fedora version details:               -bash-4.2$ cat /etc/fedora-release      Generic release 17 (Generic)     -bash-4.2$       Simply trying to install `emacs` does not work:               -bash-4.2$ sudo yum install emacs     Loaded plugins: langpacks, presto, refresh-packagekit     Package 1:emacs-24.1-7.fc17.x86_64 already installed and latest version     Nothing to do     -bash-4.2$


How can I embed subtitles into videos with ffmpeg?

I'm told it's possible to embed subtitles (`.srt`) into video files (`.avi`) using `ffmpeg`, but I can't find any mention of it in the man page. Is this possible? What command do I use?


perl script explanation please

> Write a perl program that reads in a text file containing one word per line. > Create a hash containing the words read as keys and the number of times they > have been read as the value. Print out each word and its frequency.               print $ARGV[0]."\n";          open (FILE,$ARGV[0]);     while ($line = <FILE>)     {             chomp($line);             if (exists($count{$line}))             {                 $count{$line}++;             }             else             {                 $count{$line} = 1;             }     }          while ( ($word,$occurrences) = each(%count))     {         print $word."  ".$occurrences."\n";          }        1. Shouldn't it be `open INFILE` instead of `FILE`?   2. `$count{$line}`: what is the role of `$count` in here? Can't you just write `$line++`?   3. Can you please explain this sentence?               while ( ($word,$occurrences) = each(%count))


Has anyone got the Android NDK toolchains to run on ARM instead of x86 or x86_64?

I have been going over the "dev scripts" in the `$NDK/build/tools` directory of the Android NDK and have been modifying them to build host/build tool- chains that run on ARM instead of x86 or x86_64. For instance:               edge-case@Flubber:/opt/ndk/toolchains/arm-linux-androideabi-4.8/prebuilt     /linux-x86/bin$ file arm-linux-androideabi-gcc     arm-linux-androideabi-gcc: ELF 32-bit LSB executable, Intel 80386,     version 1 (SYSV), dynamically linked (uses shared libs), for     GNU/Linux 2.6.8, stripped      I want it to be for ARM not Intel 80386 or any Intel derivative, unless its an Intel ARM (I think there are/was Strongarm? can't recall atm ;p). If not, I guess I can do it myself. Almost to the point where I think I can compile the gcc tools for arm without the scripts stopping me first. I can't really cross compile anything on my old a$$ HP right now, it only has 512MB of ram and my phone has 4x that with a dual core processor where as my HP is but one core and 10+ years old. I'm basically SOL after a borked Windows install on a partition of my Laptop (Just to play Neverwinter), which had 8 gigs of ram and a 2.6 ghz dual core 64 bit cpu, screwed up my BIOS, not sure what MS was doing with their dirty fingers all over my BIOS, but what ever, I never want to see a start menu for the rest of my life. I've borked at least 20 *nix based installs and never was my computer left inoperable, atm I can't even get into my BIOS to change anything, just a black screen no matter what I do. Anyways, I have tried Google'ing stuff like "Android NDK for arm" or "Android NDK run on arm" but can't find anything. The Ubuntu repos have the arm-linux- androideabi-* tools, but likewise, for x86 and x86_64 only. I don't need a cross compiler to compile native stuff, I need a native compiler to compile native stuff, hope that makes sense. Has this already been accomplished? It would save me some time, say if I could look over their build scripts and maybe incorporate them into the r9d revisions.


How can I install STREAMS in Linux?

I searched on Google, but found nothing useful. I use SUSE now, how can I install LiS on my computer? I'm hoping for a download link.


Setting NTP Server on Raspberry Pi with EM411 GPS Module

So for my little project, I'm trying to set up an ntp server using Raspberry Pi and GPS Modul EM411. First I connect the gps module, install gpsd, gpsd- clients, and python-gps. Then I run this:               sudo gpsd /dev/ttyAMA0 -n -F /var/run/gpsd.sock      to start gpsd. I check whether the gps receiving data or not with cgps -s and the result is               ┌───────────────────────────────────────────┐┌─────────────────────────────────┐     │    Time:       2014-06-04T06:43:34.000Z   ││PRN:   Elev:  Azim:  SNR:  Used: │     │    Latitude:     6.896813 S               ││   3    41    001    32      Y   │     │    Longitude:  107.607862 E               ││  11    65    174    38      Y   │     │    Altitude:   775.5 m                    ││  32    29    169    18      Y   │     │    Speed:      0.7 kph                    ││  19    57    004    32      Y   │     │    Heading:    83.3 deg (true)            ││  23    65    295    35      Y   │     │    Climb:      11.6 m/min                 ││  20    30    213    22      Y   │     │    Status:     3D FIX (2 secs)            ││  27    24    019    22      Y   │     │    Longitude Err:   +/- 13 m              ││  31    20    105    26      Y   │     │    Latitude Err:    +/- 7 m               ││   1    39    183    17      Y   │     │    Altitude Err:    +/- 42 m              ││  13    34    319    18      Y   │     │    Course Err:      n/a                   ││                                 │     │    Speed Err:       +/- 94 kph            ││                                 │     │    Time offset:     1.956                 ││                                 │     │    Grid Square:     OI33tc                ││                                 │     └───────────────────────────────────────────┘└─────────────────────────────────┘      So I think the gps module have been connected. Then I edit /etc/ntp.conf to allow ntpd to read from SHM driver:               # /etc/ntp.conf, configuration for ntpd; see ntp.conf(5) for help          driftfile /var/lib/ntp/ntp.drift          # Enable this if you want statistics to be logged.     #statsdir /var/log/ntpstats/          statistics loopstats peerstats clockstats     filegen loopstats file loopstats type day enable     filegen peerstats file peerstats type day enable     filegen clockstats file clockstats type day enable          # You do need to talk to an NTP server or two (or three).     #server ntp.your-provider.example     server 127.127.28.0 minpoll 4     fudge 127.127.28.0 time1 0.000 refid SHM          # pool.ntp.org maps to about 1000 low-stratum NTP servers.  Your server will     # pick a different set every time it starts up.  Please consider joining the     # pool: <http://www.pool.ntp.org/join.html>     server 0.id.pool.ntp.org iburst     server 1.id.pool.ntp.org iburst     server 2.id.pool.ntp.org iburst     server 3.id.pool.ntp.org iburst      and restarted ntpd. But when I checked with ntpq -p, it looks like ntpd isn't connected to shm driver (reach=0)                    remote           refid      st t when poll reach   delay   offset  jitter     ==============================================================================      SHM(0)          .NMEA.           0 l    -   16    0    0.000    0.000   0.000     -ntp.uii.net.id  103.1.106.69     2 u   95  128  177  147.792   60.964  90.883     +dns2.lipi.go.id 10.84.87.146     2 u   93  128  357  113.238    1.079  38.668     *ns2.king.net.id 130.149.17.21    2 u   94  128  157  140.766   21.119  23.014     +uranus.datautam 129.6.15.28      2 u   32  128  333  177.834  -12.765  22.652     -ntp.kim.lipi.go 133.243.238.243  2 u   99  128  377   92.180   25.108  59.973     +ns1.jkt.datauta 42.204.179.159   2 u   96  128  357  141.063   -9.681  24.305      I've check if gpsd is running fine. I've run gpsd with -n option. So where did it goes wrong? UPDATE: I've found out that ntpd is running as user ntp, while SHM can only be access as root (http://www.bentasker.co.uk/blog/general/254-ntpd-refusing-to- accept-time-from-gpsd). So I followed the instruction there by change the user ntpd run to root               sudo nano /etc/init.d/ntpd          ....     RUNASUSER=root     ....      Restarting the service and then check it whether ntpd running as root:               ps aux | grep ntp          root      8823  0.0  0.3   5520  1736 ?        Ss   14:24   0:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 0:0     pi        8871  0.0  0.1   3548   800 pts/0    S+   14:34   0:00 grep --color=auto ntp      But ntp still can't get the time from shm driver. The result still like above.


Alternative keyboard-triggred launcher for specific file type in file managers (Dolphin and/or nautilus)

Is it possible to have an (or some) alternative launchers (i.e. Open With) for each file type and be able to trigger them using keyboard modifier keys (Shift, Ctrl & Alt) in linux's `KDE` and/or `Gnome` file managers (`Dolphin` and/or `Nautilus`)? For example I want to use both `mplayer` & `VLC` for playing video files but I want VLC be the main and mplayer be the alternative (#1); so when I double click or hit enter on a video file it will open with `VLC` but when I do the same holding Shift/Ctrl/Alt it open with `mplayer`... Is there such a feature? Thanks


Highlight extra white spaces and fixed length column in VIM

I want to highlight extra white spaces and fixed length column (e.g., 80 character in a line) using VIM I created two vimrc rule in my `.vimrc` file               highlight ExtraWhitespacea ctermbg=darkred guibg=#382424     match ExtraWhitespacea /\s\+$/     highlight OverLength ctermbg=green ctermfg=white guibg=#592929     match OverLength /\%81v.\+/      Now, problem is - these rules run exactly as I want if applied separately, but will not work together. Am I missing something here? How do I debug this?


Pxeboot: Client not getting ip address from the DHCP Server

I am Working on Pxeboot. I have a Ubuntu system as KVM and in that system I installed Virtual machine manager. I also installed Ubuntu in the virtual machine. Before I start my virtual machine, I attached the Virtual network interface.               Source device: Host device eth0:macvtap     Device model : Hypervisor default     Mac Address  : 00:22:11:01:22:55     Source mode  : private      I installed DHCP server in the VM:               # apt-get install isc-dhcp-server      And configured in the `dhcpd.conf` file:               allow booting;     allow bootp;          filename "pxelinux.0"          subnet 10.5.5.0 netmask 255.255.255.0 {       range 10.5.5.5 10.5.5.100;       option domain-name-servers ns1.testworld.local.net;       option domain-name "testworld.local.net";       option routers 10.5.5.1;       option broadcast-address 10.5.5.254;       default-lease-time 600;       max-lease-time 7200;      }          host pxebootserver {       hardware ethernet 00:22:11:01:22:55             fixed-address 10.5.5.1      }      When I restart the isc-dhcp-server, I got this errors in syslog:               Jul  2 20:06:19 ubuntu dhcpd: Wrote 0 leases to leases file.     Jul  2 20:06:19 ubuntu dhcpd:      Jul  2 20:06:19 ubuntu dhcpd: No subnet declaration for eth0 (no IPv4 addresses).     Jul  2 20:06:19 ubuntu dhcpd: ** Ignoring requests on eth0.  If this is not what     Jul  2 20:06:19 ubuntu dhcpd:    you want, please write a subnet declaration     Jul  2 20:06:19 ubuntu dhcpd:    in your dhcpd.conf file for the network segment     Jul  2 20:06:19 ubuntu dhcpd:    to which interface eth0 is attached. **     Jul  2 20:06:19 ubuntu dhcpd:      Jul  2 20:06:19 ubuntu dhcpd:      Jul  2 20:06:19 ubuntu dhcpd: Not configured to listen on any interfaces!     Jul  2 20:10:26 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9     Jul  2 20:10:35 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 21     Jul  2 20:10:56 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12     Jul  2 20:11:08 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 17     Jul  2 20:11:25 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 10     Jul  2 20:11:35 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12     Jul  2 20:11:47 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 16     Jul  2 20:12:03 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11     Jul  2 20:12:14 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 9     Jul  2 20:12:23 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 11     Jul  2 20:12:34 ubuntu dhclient: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3     Jul  2 20:12:37 ubuntu dhclient: No DHCPOFFERS received.     Jul  2 20:12:37 ubuntu dhclient: No working leases in persistent database - sleeping.      Even clients cannot discover the dhcp server. Which virtual network adapter do I have to enable in the Client VM?


Copy a file from a nautilus-script to clipboard

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


Extend validity time of APACHE certificate

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


a string representation using regex (modified)

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


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

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


Nginx 502 Bad Gateway

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


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

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


referring to files inside a jar or zip files in Linux

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


Convert rgba color value to a Terminal supported color

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


Telnet to port 80 is not showing results

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


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

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


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

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


sed - replace string with file contents

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


Give every IP address a different hostname?

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


Daylight saving option on Linux servers

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


Can I reload variable in a watch command?

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


How do you make samba follow symlink outside the shared path

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


Cut on both characters and field

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


Make a symbolic link to a relative pathname

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


How to reorder a large number of columns?

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


Shell script how to read input from a file

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


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

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


Library mismatch OpenSUSE 12.3 - totally borked, update gone bad

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


Saving bash history from multiple Konsole not working correctly

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


How do I configure OpenCV and Cygwin to work together?

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


How to access web server running on Palm Pre from another machine?

I have a Palm Pre, and I've installed my webserver on it, it listens on port 8080. It works, when I open 192.168.1.104:8080 on the Pre's browser (that's the IP address of the device, I've failed with localhost or 127.0.0.1), it shows images, everything is OK. But I can't access the webserver from outside, e.g. from my desktop machine, it shows timeout. Is there a firewall on the Pre, or what's wrong? I can change server's port number, if necessary. I didn't configured the Pre, just installed SSH. Also, I can SSH to Pre, and from Pre to my desktop. **UPDATE:** _ifconfig_ says:               eth0      Link encap:Ethernet  HWaddr 00:1D:FE:B5:99:51                 inet addr:192.168.1.104  Bcast:192.168.255.255  Mask:255.255.0.0               UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1               RX packets:486 errors:0 dropped:0 overruns:0 frame:0               TX packets:284 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:1000                RX bytes:69398 (67.7 KiB)  TX bytes:40051 (39.1 KiB)          lo        Link encap:Local Loopback                 inet addr:127.0.0.1  Mask:255.0.0.0               UP LOOPBACK RUNNING  MTU:16436  Metric:1               RX packets:1248 errors:0 dropped:0 overruns:0 frame:0               TX packets:1248 errors:0 dropped:0 overruns:0 carrier:0               collisions:0 txqueuelen:0                RX bytes:128070 (125.0 KiB)  TX bytes:128070 (125.0 KiB)      _iptables -nvL_ says:               Chain INPUT (policy DROP 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                370 29404 ACCEPT     tcp  --  eth0   *       0.0.0.0/0            0.0.0.0/0           tcp dpt:22       1248  128K ALLOWED_PACKETS  all  --  lo     *       0.0.0.0/0            0.0.0.0/0                    0     0 INVALID_PACKETS  all  --  !lo    *       127.0.0.0/8          0.0.0.0/0                    0     0 REJECT     tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:113 flags:0x17/0x02 state NEW reject-with tcp-reset          0     0 DROP       tcp  --  bridge0 *       0.0.0.0/0            0.0.0.0/0           tcp dpts:4444:4445         47 28580 ALLOWED_PACKETS  all  --  *      *       0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED          0     0 ALLOWED_PACKETS  all  --  bridge0 *       0.0.0.0/0            0.0.0.0/0                    0     0 ALLOWED_PACKETS  all  --  usb0   *       0.0.0.0/0            0.0.0.0/0                    0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 0 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 5 icmp type 0          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 3 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 5 icmp type 3          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 4 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 5 icmp type 4          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 5 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 5 icmp type 5          3   252 ICMPFLOOD  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 8 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           icmp type 11 state NEW          0     0 ALLOWED_PACKETS  icmp --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 5 icmp type 11          0     0 ALLOWED_PACKETS  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:5353          0     0 ALLOWED_PACKETS  udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:5353          0     0 ALLOWED_PACKETS  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp dpt:3689          0     0 ALLOWED_PACKETS  udp  --  *      *       0.0.0.0/0            0.0.0.0/0           udp dpt:3689          0     0 ALLOWED_PACKETS  tcp  --  *      *       0.0.0.0/0            0.0.0.0/0           tcp flags:0x04/0x04         36  4604 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 3/sec burst 5 LOG flags 0 level 7 prefix `IPT_PACKET_DROPPED_NO_MATCH: '         36  4604 QUEUE      all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)      pkts bytes target     prot opt in     out     source               destination                  0     0 INVALID_PACKETS  all  --  *      *       0.0.0.0/0            0.0.0.0/0           state INVALID           Chain OUTPUT (policy ACCEPT 1541 packets, 166K bytes)      pkts bytes target     prot opt in     out     source               destination                   Chain ALLOWED_PACKETS (20 references)      pkts bytes target     prot opt in     out     source               destination               1298  157K ACCEPT     all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain ICMPFLOOD (1 references)      pkts bytes target     prot opt in     out     source               destination                  3   252            all  --  *      *       0.0.0.0/0            0.0.0.0/0           recent: SET name: ICMP side: source          0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           recent: UPDATE seconds: 1 hit_count: 6 TTL-Match name: ICMP side: source limit: avg 1/sec burst 1 LOG flags 0 level 4 prefix `IPT_ICMPFLOOD: '          0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0           recent: UPDATE seconds: 1 hit_count: 6 TTL-Match name: ICMP side: source          3   252 ALLOWED_PACKETS  all  --  *      *       0.0.0.0/0            0.0.0.0/0                     Chain INVALID_PACKETS (2 references)      pkts bytes target     prot opt in     out     source               destination                  0     0 LOG        all  --  *      *       0.0.0.0/0            0.0.0.0/0           limit: avg 1/sec burst 100 LOG flags 0 level 4 prefix `IPT_INVALID_PACKETS_DROPPED: '          0     0 DROP       all  --  *      *       0.0.0.0/0            0.0.0.0/0                 I assume, TCP should be accepted for port 8080 or whatever I want, just as for 22 (SSH).


Command to list assigned dhcp addresses

Is there a command I can use to ask the dhcpd server which addresses have been assigned?


How to mount '.img' file (extracted cubian file) in ubuntu

I used this command               sudo mount -t ext2 -o loop Cubian-desktop-r1-a20.img mountpoint      Output from this command is               mount: wrong fs type, bad option, bad superblock on /dev/loop0,            missing codepage or helper program, or other error            In some cases useful info is found in syslog - try            dmesg | tail  or so


Why doesn't “ping -l” works when ping works?

Bye all,               ping AddressIp     64 bytes from indirizzoIp: icmp_req=1 ttl=42 time=149 ms      while if               ping AddressIp -l 1400      ping: cannot set preload to value > 3          ping AddressIp -t -l 1400     ping: can't set unicast time-to-live: Invalid argument      Why can't I ping?


permissions 755 on /home/<user>/

I am wondering why by default my directory `/home/<user>/` has permissions set to `755`. This allows other users to enter into directories and read files in my home. Is there any legitimate reason for this ? Can I set the permissions to `700` for my home and all sub directories , for example:               chmod -R o-xw /home/<user>/      chmod -R g-xw /home/<user>/      without breaking anything ? Also, is it possible to set the permissions on my home, so that all new files created will have `600` and directories `700` ?


log all the email send by the root

I'm new in Linux and just installed a private script and want to capture all traffic, to know if this script send my logs or other things via email.


How to install cacti in SUSE Linux Enterprise Server?

I want to install cacti in my SUSE Enterprise Server 11 Edition. What steps do I need to do to accomplish that?


Some questions compiling linux kernel with make-kpkg

I'm doing my first steps compiling the linux kernel and adding a new system call. I've managed to do it, but I still have some questions. For this task, I has set up a Virtual Machine guesting debian 7 64 bits. I am following a tutorial found in Internet of how to do this (http://arvindsraj.wordpress.com/2012/10/05/adding-hello-world-system-call-to- linux/) And as documentation, overall, a manual of how to create a custom linux kernel in Debian GNU/Linux and the manual page for make-kpkg. So far, I am using the next script to compile:               #!/bin/sh     make-kpkg clean     INSTALL_MOD_STRIP=1 CONCURRENCY_LEVEL=2 time make-kpkg --initrd --append-to-version=-$1 kernel_image      And, well, I have the following questions:   1. Right now, I'm defining kernel_image only as target. Should I include also kernel_headers? when should I compile and install the kernel_headers? what are they for?   2. If I use as target: binary_arch, is exactly the same than using kernel_image and kernel_headers?   3. I put INSTALL_MOD_STRIP=1 because I read that it compiles it faster and the output is much smaller. I know it reduces the number of modules being compiled. how much is this reduction? Should I use this flag for a final compilation for a final use of the kernel in my computer?? Thank you in advance!