I am writing a bash script to make a deployment tarball and the script must work across OSX and Linux. I have a directory structure as shown below and in a bash script I need to tar the contents excluding ./foo but including ./baz/foo Simple! Normally I would do this by passing –exclude=’./fooR…
Unable to run .py file from putty, Syntax error: word unexpected (expecting “)”)
I am new to both Python and Linux and as such request simple explanations with minimal assumed knowledge where possible please, however I am more than willing to invest time and effort to learn. I have a Raspberry Pi 2 (Model B V1.1) that is running Linux. I interact with this pi via putty. I am trying to cre…
How to find files that contain two or more of a specific character?
I’m learning about wildcards and I’m trying to figure out how to find filenames that contain a specific character, two or more times. For example, finding filenames that have two or more x’s in them, such as Xerox. I know how to find files that have an *x, or that have an *ox*, but I canR…
How to remove a broken installation of glibc
I just attempted to install glibc version 2.19 to my computer as follows: 1) I cloned the glibc git repo with 2) I checked out version 2.19 with 3) I made a directory objdir in my home directory, and built the installation there with 4) I tested the make with This gave me an error, but some webpage I found
Logstash File Input Latency on Linux
Logstash is running. How long takes it from adding a single line to a log file until Logstash recognize the new line and start to transform and output it. With a simple BASH script I measure from 99 msec up to 800 msec including a transformation. It’s clear that the latency depends on the Logstash trans…
Packer Amazon EBS Chef – sorry, you must have a tty to run sudo
I want to use Packer for provisioning image for amazon ebs using chef. I am getting the following error message: example.json Output I think the relevant error message is: Does anybody have an idea? Answer You can use ssh_pty : true to have a TTY.
perf enable demangling of callgraph
How do I enable C++ demangling for the perf callgraph? It seems to demangle symbols when I go into annotate mode, but not in the main callgraph. Sample code (using Google Benchmark): build command: perf commands: I’ve also tried enabling the –demangle option, but that doesn’t seem to affect …
DataStax opscenterd won’t start on Ubuntu 15.04 x64
Issue: sudo service opscenterd start Failed to start opscenterd.service: Unit opscenterd.service failed to load: No such file or directory. (ERROR)-(Exit Code 6)-(Unknown error code) sudo service opscenterd status opscenterd.service Loaded: not-found (Reason: No such file or directory) Active: inactive (dead)…
Mem alloced via mmap without munmap will cause leak after process exits or terminals
there is the code about alloc mem via mmap void *ret = mmap(NULL, 4 * 1024, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0); when process exits normally, the memory will be return to os ? Answer According to the man and under unmap: The region is also automatically unmapped when the process is terminat…
Tftp commands implementation to fetch remote data in a local ring buffer
I was looking for an implementation using tftp command sets which can fetch data from a remote server but instead getting data completely as a whole, it fetches the data in a local ring buffer of size lesser than the remote file size and it overwrites the data after the ring has been circled. So, if any proce…