"coffee" command fails silently, how to debug? - coffeescript

When using coffee-script this command runs ok on 1 computer but silently fails on another.
coffee --output dir --compile dir
make: *** [js] Error 1
How can I debug? Any flags for verbose output?
npm list -g
/usr/local/lib
├─┬ coffee-script#1.7.1
│ └── mkdirp#0.3.5
├── csso#1.2.15
└── uglify-js#1.3.2
Even coffee --version fails with no output

It was a terrible mix of old Ubuntu's/new packages.
Needed to remove node, nodejs packages.
Install new versions from PPA
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install python-software-properties python g++ make nodejs
Reinstall coffee-script: sudo npm install coffee-script -g
Thanks

Related

daq with error make: *** [Makefile:344: Makefile.in] Error 1

I learn about Snort and when I install it, I must install daq. When I implement./configure && make && sudo make install I see this warning:
cd . && /bin/bash /home/snort/snort_src/daq-2.0.7/missing automake-1.15 --foreign
/home/snort/snort_src/daq-2.0.7/missing: line 81: automake-1.15: command not found
WARNING: 'automake-1.15' is missing on your system.
You should only need it if you modified 'Makefile.am' or
'configure.ac' or m4 files included by 'configure.ac'.
The 'automake' program is part of the GNU Automake package:
http://www.gnu.org/software/automake
It also requires GNU Autoconf, GNU m4 and Perl in order to run:
http://www.gnu.org/software/autoconf
http://www.gnu.org/software/m4/
http://www.perl.org/
make: *** [Makefile:344: Makefile.in] Error 1
I installed autoconf, automake 1.16.1, imlement autoreconf -f -i before but not succeed.
Someone can help me fix it?
Since your installing daq-2.0.7, I assume you are installing snort version ~2.9.And which version of linux/unix OS your testing installation with?
If your on Centos7.7, here a list of neccessary packages
yum update -y
yum install epel-release -y
yum install gcc gcc-c++ libnetfilter_queue libnetfilter_queue-devel git flex bison zlib zlib-devel pcre pcre-devel libdnet libdnet-devel tcpdump libnghttp2 wget xz-devel lzma -y
See snort documents for more details: https://www.snort.org/documents

Docker file for building code cloned from git

I've cloned a copy of FreeCAD from github and I'm trying to create a docker file so that I can develop it locally on my machine.
The objectives being that:
I have a local copy of the code from git on my machine
I can make modifications to the code
I can build debug and release image (do I need to create two separate images?)
Have access to the code on my machine, so that I can use git for source control
This is the content of my Dockerfile:
# Get base image
FROM phusion/baseimage
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# Get the build pre-requisites
RUN apt-get update
RUN apt-get install -y build-essential cmake python python-matplotlib libtool
RUN apt-get install -y libcoin80-dev libsoqt4-dev
RUN apt-get install -y libxerces-c-dev libboost-dev libboost-filesystem-dev
RUN apt-get install -y libboost-regex-dev
RUN apt-get install -y libboost-program-options-dev libboost-signals-dev
RUN apt-get install -y libboost-thread-dev libboost-python-dev libqt4-dev
RUN apt-get install -y libqt4-opengl-dev qt4-dev-tools python-dev
RUN apt-get install -y python-pyside pyside-tools
RUN apt-get install -y liboce*-dev oce-draw
RUN apt-get install -y libeigen3-dev libqtwebkit-dev libshiboken-dev
RUN apt-get install -y libpyside-dev libode-dev swig libzipios++-dev
RUN apt-get install -y libfreetype6 libfreetype6-dev
# to make Coin to support additional image file formats
RUN apt-get install -y libsimage-dev
# to register your installed files into your system's package manager, so yo can easily uninstall later
RUN apt-get install -y checkinstall
# needed for the 2D Drafting module
RUN apt-get install -y python-qt4 python-pivy
# doxygen and libcoin80-doc (if you intend to generate source code documentation)
RUN apt-get install -y doxygen libcoin80-doc
# libspnav-dev (for 3Dconnexion devices support like the Space Navigator or Space Pilot)
RUN apt-get install -y libspnav-dev
# CMAke related issue for compiling on Ubuntu Xenial: http://forum.freecadweb.org/viewtopic.php?f=4&t=16292
RUN apt-get install -y libmedc-dev
RUN apt-get install -y libvtk6-dev
RUN apt-get install -y libproj-dev
# Get git
RUN apt-get install -y git
RUN git clone https://github.com/FreeCAD/FreeCAD.git freecad
RUN cd freecad
RUN mkdir freecad-debug
RUN cd freecad-debug
# command below is just a diagnostic to let me know wth I am (output is: /)
# RUN pwd
RUN cmake ../ -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Debug .
#cmake -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Release .
RUN make
I attempt to build the image using the following command:
docker build -tag freeCAD-my-fork .
Everything works until I get to the first cmake invocation. I then get the following error:
CMake Error: The source directory "/" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
The command '/bin/sh -c cmake ../ -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Debug .' returned a non-zero code: 1
I placed a RUN pwd in my Dockerfile, so I could find where the cmake command was being run from, and I was surprised to find that it was been run from the root directory.
I thought the issue was being caused by my use of relative and that it would be fixed by absolute paths - however specifying /path/to/my/copy/freecad when cloning etc, the issue remains.
How can I write my Dockerfile so that it achieves the objectives outlined above (stated at the beginning of my question)?
Default WORKDIR in docker is "/".All docker commands will be executed in that directory.There are two option either you change WORKDIR(https://docs.docker.com/engine/reference/builder/#workdir) or execute everything in one layer(In one RUN command).I have taken second approach.
Cloning and Building source code both executed in One layer of docker.
RUN git clone https://github.com/FreeCAD/FreeCAD.git freecad \
&& cd freecad \
&& mkdir freecad-debug \
&& cd freecad-debug \
&& cmake ../ -DFREECAD_USE_EXTERNAL_PIVY=1 -DCMAKE_BUILD_TYPE=Debug . \
&& make
You should install all your dependencies using run as you do but the actual building and copying of source code files should not happen when you build your image but when you run a container.
This way you can reuse your image for as many builds as you like.
Write a script with the build commands and copy it over to your image. Then in the CMD part of the dockerfile run that script.
To share the git project with the container you can mount your local files with docker run -v hostpath:containerpath imagename. That way any files in hostpath will be visible to the container at containerpath and vice versa. Alternatively you could also git clone from the script which is invoked by CMD but then you have to expose the build somehow to your host (some mounted volume again).

How can I install MP4Box on CentOS7.3

I can't install MP4Box on CentOS7.3.
CentOS Linux release 7.3.1611 (Core)
I attempted to install with reference to the following URL.
https://www.24x7serversolutions.com/blog/install-mp4box-on-centos/
yum -y install freetype-devel SDL-devel freeglut-devel
wget http://repo.bstack.net/mp4box/gpac-0.4.5.tar.gz
wget http://repo.bstack.net/mp4box/gpac_extra_libs-0.4.5.tar.gz
tar -zxvf gpac-0.4.5.tar.gz
tar -zxvf gpac_extra_libs-0.4.5.tar.gz
cd gpac_extra_libs
cp -r * /usr/local/src/gpac/extra_lib
cd ..
cd gpac
chmod 755 configure
./configure
But, at the time of this command,
make lib
・・・
gcc: エラー: unrecognized command line option ‘-Wl’
gcc: エラー: unrecognized command line option ‘--warn-common’
make[1]: *** [libgpac.so] エラー 1
make[1]: ディレクトリ `/home/source/gpac/src' から出ます
make: *** [lib] エラー 2
I tried to set ln as following.
ln -s /usr/lib64/libglut.so.3 /usr/lib64/libglut.so
But, the same error was displayed.
How do I deal with it?
This is how I installed the latest version of MP4Box from the GitHub. The main purpose of this script is to install the MP4Box to docker centos amazoncorretto container.
yum -y install freetype-devel SDL-devel freeglut-devel ugcc gcc-c++ git libtool make zlib-devel
git clone https://github.com/gpac/gpac gpac_public
cd gpac_public
./configure --static-mp4box
make
make install
This is the combination of two resources:
https://github.com/gpac/gpac/wiki/GPAC-Build-Guide-for-Linux
https://gist.github.com/helpsquad/48ee2baf2eb5ee655e8755618b4c8c75
If you need MP4Box only from GPAC, I recommend that you follow this tutorial.
You need the following packages: git, gcc, make, libpthread-devel.
Execute these command-lines:
git clone https://github.com/gpac/gpac.git
cd gpac
./configure --static-mp4box --use-zlib=no
make -j4
sudo make install
I think there might be a bug in that version of gpac. Try this instead:
yum -y install freetype-devel SDL-devel freeglut-devel
git clone https://github.com/gpac/gpac
cd gpac
git checkout tags/v0.6.1 -b v0.6.1
./configure
make lib
Well it's there on the official "rpmfusion-free" repository.
Just do:
sudo yum install gpac
(Taken from: http://rahul-ghose.blogspot.com/2017/05/install-mp4-box-on-centos.html)
Mp4Box included in gpac, so you must install gpac.
yum install gpac

npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2

$ npm update minimatch#3.0.2
$ npm update -d
npm info it worked if it ends with ok
npm info using npm#2.11.3
npm info using node#v0.12.7
npm info attempt registry request try #1 at 5:33:55 PM
npm http request GET https://registry.npmjs.org/jshint
npm http 200 https://registry.npmjs.org/jshint
npm info ok
$ npm install jshint
npm WARN deprecated minimatch#2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch#0.3.0: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
jshint#2.9.2 node_modules\jshint
├── strip-json-comments#1.0.4
├── exit#0.1.2
├── shelljs#0.3.0
├── console-browserify#1.1.0 (date-now#0.1.4)
├── lodash#3.7.0
├── minimatch#2.0.10 (brace-expansion#1.1.5)
├── htmlparser2#3.8.3 (domelementtype#1.3.0, entities#1.0.0, domhandler#2.3.0, d omutils#1.5.1, readable-stream#1.1.14)
└── cli#0.6.6 (glob#3.2.11)
npm install -g minimatch#3.0.2
try this....Should Work
Sorry for the late reply..
sudo npm install
Try this..this works For me to install npm
To update use this..
sudo npm install -g npm#3
Try this (for OSX)
Enter Into Terminal sudo chown -R $USER /usr/local
Works for me downgrading to node v4.4.7 and with sudo chown -R $USER /usr/local in terminal.
I can fix it.
npm install minimatch
+ minimatch#3.0.4
sudo npm install -g minimatch#3.0.4
Try this. It run good for me.
Here, I worked in reactJS with bebel script and try to install npm in my directory. At that time I found this error. I have solved this error by below command.
Run this command in cmd:
npm install browserify babelify babel-preset-env
While chown is one way of going about this, I've always regarded it as the least favorable. Rather than change the owner of system files, it makes more sense to run npm config set prefix $HOME/.node_modules. This will configure npm to look for your node_modules in your home directory, rather than globally.
See https://docs.npmjs.com/getting-started/fixing-npm-permissions.

Configuring Amazon Elastic Beanstalk with PostGIS

Does anyone have any experience setting up Amazon Elastic Beanstalk with PostGIS (so that I can take advantage of Geodjango)?
There are a number of features that the default setup (RDS, featuring MySQL) does not currently support out of box:
1. PostgreSQL + PostGIS
2. The ability to install C/C++ libraries such as GEOS and Proj.4
Thanks in advance
If you want to use geodjango with Amazon Elastic Beanstalk you need to create a custom AMI where you can install PostGIS and then point your Elastic Beanstalk Application to that AMI when spinning up.
Here is a good tutorial on how to customize an EBS AMI. There is also an AWS tutorial for that but I found the first one easier to understand. On my custom AMI I installed geos, gdal, proj4 and postgis from source, and postgres using yum install postgres. Below are the commands i used to install all libraries into the AMI.
For the django app to find the libraries, I also set an additional environmental variable in the AWS EBS Console. In the menubar of my environment, I went to configuration --> software configuration and edited the Environment Properties by adding the property LD_LIBRARY_PATH set as /usr/local/lib/:$LD_LIBRARY_PATH.
Since the beanstalk app instances are not forseen to run the database themselves, I also set up a Amazon RDS Postgres hosted database which is a relatively new service, it supports PostGIS.
If you put that all together, you should get a very scaleable GeoDjango app!
sudo yum install postgresql postgresql-devel postgresql-server postgresql9-contrib gcc gcc-c++ make libtool curl libxml2 libxml2-devel python-devel
wget http://download.osgeo.org/proj/proj-4.8.0.zip
unzip proj-4.8.0.zip
cd proj-4.8.0
./configure
make
sudo make install
cd ..
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
tar -xvf geos-3.4.2.tar.bz2
cd geos-3.4.2
./configure
make
sudo make install
cd ..
wget http://download.osgeo.org/gdal/1.10.1/gdal1101.zip
unzip gdal1101.zip
cd gdal-1.10.1
./configure --with-python=yes
make
sudo make install
cd ..
wget http://download.osgeo.org/postgis/source/postgis-2.1.1.tar.gz
tar -xvf postgis-2.1.1.tar.gz
cd postgis-2.1.1
./configure
make
sudo make install
You can also do it without a custom AMI, just use ebextensions. I tested this with Amazon Instance (2013.09) ami-35792c5c so use that one instead of the newer ones. If you have your Django in Elastic Beanstalk 101 completed, you know about ebextensions. The ebextensions below will quickly get going you can use the following ebextensions. Just place the following in your .ebextensions folder at the base of your repository. I also include postgres 9.3 and memcached in these config files:
00_repo_ostgis.config:
files:
"/etc/yum.repos.d/pgdg-93-redhat.repo":
mode: "000644"
owner: root
group: root
content: |
[pgdg93]
name=PostgreSQL 9.3 $releasever - $basearch
baseurl=http://yum.postgresql.org/9.3/redhat/rhel-6-$basearch
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-93
[pgdg93-source]
name=PostgreSQL 9.3 $releasever - $basearch - Source
failovermethod=priority
baseurl=http://yum.postgresql.org/srpms/9.3/redhat/rhel-6-$basearch
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-PGDG-93
commands:
epel_repo:
command: yum-config-manager -y --enable epel
remi_repo:
command: yum-config-manager -y --enable remi
packages:
rpm:
pgdg-redhat93-9.3-1: 'http://yum.postgresql.org/9.3/redhat/rhel-6-x86_64/pgdg-redhat93-9.3-1.noarch.rpm'
remi: 'http://rpms.famillecollet.com/enterprise/remi-release-6.rpm'
qt4-devel: 'http://mirror.centos.org/centos/6/os/x86_64/Packages/qt-4.6.2-28.el6_5.x86_64.rpm'
01_app_postgis.config:
packages:
yum:
libtiff-devel: ''
libjpeg-devel: ''
libzip-devel: ''
freetype-devel: ''
postgresql-devel: ''
gdal: ''
gdal-python: ''
geos: ''
proj: ''
libmemcached: ''
libmemcached-devel: ''
cyrus-sasl-devel: ''
zlib-devel: ''
container_commands:
01_collectstatic:
command: 'PYTHONPATH=.:..:../lib cd site/<your_project> && ./manage.py collectstatic -c --noinput && cd ../..'
leader_only: true
02_migrate:
command: 'PYTHONPATH=.:..:../lib cd site/<your_project> && ./manage.py migrate --noinput && cd ../..'
leader_only: true
option_settings:
- namespace: aws:elasticbeanstalk:container:python
option_name: WSGIPath
value: site/<your_project>/wsgi.py
- namespace: aws:elasticbeanstalk:container:python:staticfiles
option_name: /static/
value: site/<your_project>/static/
- option_name: DJANGO_SETTINGS_MODULE
value: settings_prod
The structure of my project is a bit different. My settings file and urls.py I moved to the root of my project directory so i had to change the path to settings in wsgi.py. So adjust this accordingly. Just use the container_commands and option_settings you were using before.
Your requirements.txt file should contain at minimum:
Django==1.7.1
Pillow
psycopg2
I store most other python dependencies in ../lib which I include in my PYTHONPATH so my repo structure is like this:
<your_project>/
├── requirements.txt
├── .ebextensions/
│   ├── 00_repos_postgis.config
│   └── 01_app_postgis.config
└── site/
├── <your_project>
  │ ├── wsgi.py
  │ ├── settings_prod.py # used for EB, like settings_local.py but uses env vars
│   └── settings.py
   └── lib/
└── <all pip dependencies>
Checkout the deployment tool I built, it uses fabric. I took what I liked from EB CLI tools and adjusted till it was tailored for django: https://github.com/radlws/django-awseb-tasks
NOTE: It is extremely important that you use AMI ami-35792c5c when you launch your environment. Its the only one that worked for me for this setup. If other instances work please feel free to edit them into this answer. Also see my original question.
As i mentioned here my solution for a 2017.03 image was:
commands:
01_yum_update:
command: sudo yum -y update
02_epel_repo:
command: sudo yum-config-manager -y --enable epel
03_install_gdal_packages:
command: sudo yum -y install gdal gdal-devel
files:
"/etc/httpd/conf.d/wsgihacks.conf":
mode: "000644"
owner: root
group: root
content: |
WSGIPassAuthorization On
packages:
yum:
git: []
postgresql95-devel: []
gettext: []
libjpeg-turbo-devel: []
libffi-devel: []
If you want to use radtek's solution and want to use the latest Amazon AMI (2014.9), you might face dependency problems. This solved it for me.
Open ssh shell of your aws beanstalk. Execute below command step by step. You will get working postgis.
cd /home/ec2-user
sudo yum -y install gcc gcc-c++ make cmake libtool libcurl-devel libxml2-devel rubygems swig fcgi-devel libtiff-devel freetype-devel curl-devel libpng-devel giflib-devel libjpeg-devel cairo-devel freetype-devel readline-devel openssl-devel python27 python27-devel
# PROJ
wget http://download.osgeo.org/proj/proj-4.8.0.tar.gz
tar -zxvf proj-4.8.0.tar.gz
cd proj-4.8.0
./configure
make
sudo make install
cd ..
# GEOS
wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
tar -xvf geos-3.4.2.tar.bz2
cd geos-3.4.2
./configure
make
sudo make install
cd ..
# GDAL
wget http://download.osgeo.org/gdal/1.10.1/gdal-1.10.1.tar.gz
tar -zxvf gdal-1.10.1.tar.gz
cd gdal-1.10.1
./configure
make
sudo make install
cd ..
# PostGIS
wget http://download.osgeo.org/postgis/source/postgis-2.1.0.tar.gz
tar -xvf postgis-2.1.0.tar.gz
cd postgis-2.1.0
./configure
make
sudo make install
cd ..
Then create a symbolic link:
ln -s /usr/local/lib/libgdal.so /usr/lib/libgdal.so.1
/sbin/ldconfig
Here in alternative answer with which the python3 bindings for gdal will work in the AWS EB instance. pygdal is a nice package for “virtualenv and setuptools friendly version of standard GDAL python bindings”, but does not support 1.7.3, which is the gdal version installed using sudo yum -y install gdal gdal-devel, e.g this answer.
Thus, I had to install an updated gdal and also setup linkages to go with it. This method draws on information in yellowcap’s, radek’s and various other Stackoverflow posts.
As yellowcap said, you must set ENVIRONMENT VARIABLES that make the library linkages you need. In the AWS EB console, Configuration --> Software configuration, edit the Environment Properties adding:
LD_LIBRARY_PATH  = “/usr/local/lib/:$LD_LIBRARY_PATH”
LD_PRELOAD = ”/usr/lib/libgdal.so.1
Put the following in your .ebextensions folder at the base of your repository:
django.config:
option_settings:
"aws:elasticbeanstalk:application:environment":
DJANGO_SETTINGS_MODULE: “<your project>.settings.server_settings"
PYTHONPATH: "$PYTHONPATH"
"aws:elasticbeanstalk:container:python":
WSGIPath: “<your project>/wsgi.py"
"aws:elasticbeanstalk:container:python:staticfiles":
"/static/": "www/static/"
commands:
01_yum_update:
command: sudo yum -y update
02_pip_upgrade:
command: /opt/python/run/venv/bin/pip install --upgrade pip
ignoreErrors: false
packages:
yum:
postgresql95-devel: []
git: []
libffi-devel: []
container_commands:
01_migrate:
command: "python manage.py migrate"
leader_only: true
02_collectstatic:
command: "source /opt/python/run/venv/bin/activate && python manage.py collectstatic --noinput”
gdal.config
files:
"/opt/elasticbeanstalk/hooks/appdeploy/pre/01_install_gdal_prerequisites.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
sudo yum install -y gcc-c++ gcc libpng libtiff postgresql95-devel git libffi-devel libxml2-devel libxslt-devel htop
wget http://download.osgeo.org/proj/proj-4.9.3.tar.gz
tar -zvxf proj-4.9.3.tar.gz
cd proj-4.9.3
./configure
make -j 2
sudo make install
cd ..
rm proj-4.9.3.tar.gz
wget http://download.osgeo.org/gdal/2.3.2/gdal-2.3.2.tar.gz
tar -zvxf gdal-2.3.2.tar.gz
cd gdal-2.3.2
./configure --with-static-proj4=/usr/local/lib --with-python --with-threads --with-pg=/usr/bin/pg_config
make -j 2
sudo make install
cd ..
rm gdal-2.3.2.tar.gz
ln -s /usr/local/lib/libgdal.so /usr/lib/libgdal.so.1
sudo ldconfig
in requirements.py include the pygdal package
pygdal==2.3.2.4
You must be sure that the gdal version number matches the pygdal version number, see pygdal documentation.
Result
The following works the EC2 instance virtual env, where your django project is located:
$ python manage.py shell
In [1]: from osgeo import gdal
In [2]: