How do I test if an installed global package is working in Elastic Beanstalk running Linux Ubuntu
I'm using ssh to try to debug why GraphicsMagick isn't working. "node -v" and "ng version" both are unrecognized commands when I know those have to be installed for the app to work, and the app definitely works. So, what's the deal? How do I test if graphics magick is installed correctly?
1 answer
-
answered 2018-06-19 21:06
Steven Lu
Elastic Beanstalk provides compiled instances for you. The actual node package is located in
/opt/elasticbeanstalk/node-install
GraphicsMagick is not a pre-installed package in the Elastic Beanstalk instances and you will need to install it yourself using
.ebextensions
You'd need to create a file in your codebase like:
.ebextensions/graphicsmagick.config
with the following contents:commands: 01-command: command: yum install -y --enablerepo=epel GraphicsMagick
Reference: Graphicsmagick not working in Elastic Beanstalk with nodejs and S3
See also questions close to this topic
-
Kill port on remote server with ssh
I want kill specific port on remote host with below command:
ssh username@remoteip "fuser -k 2323/tcp"
but got
fuser: command not found
error. I spent hours googling for this but I could not find any possible solution.Any idea?
my linux distribution: centos
-
what does address space entail?
I saw this term reading "Operating System concepts". At first I thought they are a specific block in memory with a defined starting address and ending address. But then I read about fork and how a child process copies the address space of its parent, then overlay that address space with an exec call so now I'm starting to think that address space doesnt really have a defined starting and ending space, and when the child process copies the address space, it actually only copies the content into another block of memory with the same size. Which interpretation is correct or both are wrong?
-
How to track PHP transactions on Linux server?
I want to create a daemon to track PHP performance monitoring on a web server.
So I would like to somehow capture every execution of PHP files on the server and note how much time was needed for the execution and the parameters that were sent.
I have no idea where to start or what to use.
For example, the user opens the following page in the browser: http://example.com/dashboard
I want to draw the following information:
Transaction, Server time: /dashboard, 700ms
As a New Relic provides the ability to monitor PHP activity.
-
Error occurred during build: Command start_install failed while creating Corda Enterprise on AWS
I am creating a single Corda node using AWS Corda template with new VPC configuration in Ohio region. I am facing an issue during build of CordaNodeStack. Below are my system logs from failure:
89.110614] cloud-init[1459]: Error occurred during build: Command start_install failed [ 89.124327] cloud-init[1459]: + cfn_fail [ 89.124653] cloud-init[1459]: + cfn-signal -e 1 --stack Corda-NotaryA-CordaStack-xxxx-CordaNodeStack-xxxx --region us-east-2 --resource CordaInstance [ 89.369313] cloud-init[1459]: + exit 1 [ 89.370188] cloud-init[1459]: Cloud-init v. 18.2 running 'modules:final' at Mon, 18 Feb 2019 12:43:10 +0000. Up 11.40 seconds. [ 89.370632] cloud-init[1459]: 2019-02-18 12:44:28,352 - util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [1] [ 89.381955] cloud-init[1459]: 2019-02-18 12:44:28,364 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts) [ 89.389311] cloud-init[1459]: 2019-02-18 12:44:28,365 - util.py[WARNING]: Running module scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_scripts_user.py'>) failed ci-info: +++++++++Authorized keys from /home/ubuntu/.ssh/authorized_keys for user ubuntu++++++++++ ci-info: +---------+-------------------------------------------------+---------+-----------------+ ci-info: | Keytype | Fingerprint (md5) | Options | Comment | ci-info: +---------+-------------------------------------------------+---------+-----------------+ ci-info: | ssh-rsa | xxxxx | - | xxxx | ci-info: | ssh-rsa | xxxxx | - | xxxx | ci-info: +---------+-------------------------------------------------+---------+-----------------+ <14>Feb 18 12:44:28 ec2: <14>Feb 18 12:44:28 ec2: ############################################################# <14>Feb 18 12:44:28 ec2: -----BEGIN SSH HOST KEY FINGERPRINTS----- <SSH Key> <14>Feb 18 12:44:28 ec2: -----END SSH HOST KEY FINGERPRINTS----- <14>Feb 18 12:44:28 ec2: ############################################################# -----BEGIN SSH HOST KEY KEYS----- ecdsa-sha2-nistp256 <hash> root@ip-xx-x-xxx-xxx ssh-ed25519 <hash> root@ip-xx-x-xxx-xxx ssh-rsa <key> root@ip-xx-x-xxx-xxx -----END SSH HOST KEY KEYS----- [ 89.530956] cloud-init[1459]: Cloud-init v. 18.2 finished at Mon, 18 Feb 2019 12:44:28 +0000. Datasource DataSourceEc2Local. Up 89.52 seconds [[0;1;31mFAILED[0m] Failed to start Execute cloud user/final scripts. See 'systemctl status cloud-final.service' for details. [[0;32m OK [0m] Reached target Cloud-init target. Starting Daily apt download activities... [[0;32m OK [0m] Started Daily apt download activities. Starting Daily apt upgrade and clean activities... Stopped Daily apt upgrade and clean activities.
Can anyone help me with this error.
Thank you in advance.
-
S3 registerStreamWrapper and fseek
I am using PHP SDK for AWS and S3. This is part of my code:
$context = stream_context_create(array( 's3' => array( 'seekable' => true ))); $stream = fopen("s3://{$bucketname}/{$key}", 'r',false,$context); $length = $byte_to - $byte_from + 1 ; $speed = 1000*1024 ;//1000KB file_put_contents("test.txt"," before \n",FILE_APPEND); $im = fseek($stream,$byte_from); file_put_contents("test.txt"," im=".$im." \n",FILE_APPEND); while($length>0) { if($length > $speed) $read = $speed ; else $read = $length; $length = $length - $read; echo fread($stream,$read); }
After checking test.txt I saw "before" was saved to test.txt (only).It seems that fseek doesn't work. How can I change this code to a better code?
-
Iterate S3 folder to get to get recent files as per lastmodifieddate
Iterate S3 folder to get to get recent files as per
lastmodifieddate
.We have a S3 bucket having folder structure as below(data coming hourly basis):
s3://my_bucket/stream/yy/mm/dd/hh:
examples:
s3://my_bucket/stream/2019/01/01/00 s3://my_bucket/stream/2019/01/01/01 s3://my_bucket/stream/2019/01/01/02 : : s3://my_bucket/stream/2019/01/02/00 s3://my_bucket/stream/2019/01/02/01
I need to iterate folders with recent files upload as per last modified date in AWS Lambda(python 2.7).
-
syntax of python commands in ubuntu terminal: command not found
I have a file called inventory.py and it is visible in my current directory. In the file it says that there are commands:
Available commands: help - Display this message print_cfg - Write inventory file to stdout print_ips - Write a space-delimited list of IPs from "all" group Advanced usage: Add another host after initial creation: inventory.py 10.10.1.5 Delete a host: inventory.py -10.10.1.3 Delete a host by id: inventory.py -node1
inventory.py print_cfg
inventory.py: command not found
python inventory.py print_cfg
Traceback (most recent call last): File "inventory.py", line 364, in <module> sys.exit(main()) File "inventory.py", line 361, in main KubesprayInventory(argv, CONFIG_FILE) File "inventory.py", line 72, in __init__ delimiters=('\t', ' ')) TypeError: __init__() got an unexpected keyword argument 'delimiters'
./inventory.py print_cfg
-bash: ./inventory.py: Permission denied
I tried to change permission chmod 777 inventory.py ./inventory.py print_cfg
produced no output or errors
LINK TO CODE https://github.com/kubernetes-sigs/kubespray/blob/master/contrib/inventory_builder/inventory.py
I am running as root and would like to use the print_cfg command to make ensure everything is as it should be. I know this is some simple syntax issue I just have not been able to properly search out the answer.
-
How to restore *.bak files in PyCharm?
I have some *.bak files created when 2to3 command was running.
I would like to back the changes and restore from *.bak files.
Can I do it in PyCharm or with some simple commands maybe?
-
Postfix is not accepting my connection and is not either able to look up the server or is unable to log-in
I'm attempting to setup a postfix/dovecot server. I used iRedMail as a vector for most of the packages installed. They aren't allowing me to connect to it.
DNS Setup
Email is setup to be: Someone@thisemailadress.com MX record is setup to be: mail.thisemailaddress.com SPF setup under TXT record, redirects all email traffic to mail.thisemailaddress.com
A record is setup to turn
mail.thisemailaddress.com
into an IP that forwards to the VPS. VPS hosts file includesmail.thisemailaddress.com
andthisemailaddress.com
.
Packages
https://pastebin.com/Vn7LRQ1Q is a list complete of packages I have installed.
maillog
https://pastebin.com/yZ2h4LXg is the mail log
/var/log/maillog
.
Dovecot Configuration
https://pastebin.com/S9CrGUp7 is the dovecot configuration.
Postfix Configuration
Both main and master are located in the same pastebin.
Full Question
My business needs to get email going so we can communicate with our clients without issues. I installed a lot of packages that were recommended. For security I did not install the iRedAdmin package, rather I wanted to just modify it manually. I am unsure what is causing this issue, however. I did have a dovecot problem earlier that resulted from and SSL type issue, I reinstalled the SSL. Why am I unable to login to the email?
-
How can I deploy multiple application inside single elastic beanstalk container in different IIS site
Want to deploy Asp.net core application to elastic beanstalk. How can I deploy multiple application inside single container in different IIS site?
I have a custom aws-windows-deployment-manifest.json which want to deploy using vsts build pipleline.
-
How to set the health-check-type of an auto-scaling-group created by elastic-beanstalk as ELB programmatically?
I just followed this tutorial to learn how to use
eb
command.One thing I want to do is to modify the
Health Check Type
of the auto scaling group created by Elastic-Beanstalk toELB
. But I just can't find how to do it.Here's what I have done:
Change the
Health Check Type
of the environmentdev-env
toELB
through the AWS console.Use
eb config save dev-env --cfg my-configuration
to save the configuration file locally.The
ELB
health check type doesn't appear inside.elasticbeanstalk/saved_configs/my-configuration.cfg.yml
file. This means that I must specify the health check type somewhere else.
Then I find another article saying that you can put the health check type inside
.ebextensions
folder.So I make a modification to eb-python-flask, which is the example of the tutorial.
Here's my modification of eb-python-flask.
I thought that running
eb config put prod
, andeb create prod2-env --cfg prod
with my eb-python-flask would create an environment whose health-check-type of the auto scaling group isELB
. But I was wrong. The health check type created by theeb
commands is stillEC2
.Anyone know how to set the health check type programmatically?
I don't want to set it through AWS console. It's inconvenient.
-
Django and ElasticBeanstalk: Internal server error, HTTP/2 protocol will be inactive
I'm trying to deploy my Django app in eb. I've created the environment on eb and even though all things seems good internal server error happens.
I was just following the tutorial on official site. I already committed my
requirements.txt
and.ebextensions
to my git. I set the environement variables on eb configuration.But there's an internal server error. And also
eb open
doesn't work..ebextensions/django.config
option_settings: aws:elasticbeanstalk:container:python: WSGIPath: config/wsgi.py
settings.py
ALLOWED_HOSTS = ["*"]
I'm still using
sqlite3
on local.error.log
is like this[Mon Sep 17 03:26:31.366607 2018] [mpm_prefork:notice] [pid 10621] AH00169: caught SIGTERM, shutting down [Mon Sep 17 03:26:32.520377 2018] [suexec:notice] [pid 11711] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Mon Sep 17 03:26:32.536121 2018] [so:warn] [pid 11711] AH01574: module wsgi_module is already loaded, skipping [Mon Sep 17 03:26:32.538258 2018] [http2:warn] [pid 11711] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive. [Mon Sep 17 03:26:32.538272 2018] [http2:warn] [pid 11711] AH02951: mod_ssl does not seem to be enabled [Mon Sep 17 03:26:32.538809 2018] [lbmethod_heartbeat:notice] [pid 11711] AH02282: No slotmem from mod_heartmonitor [Mon Sep 17 03:26:32.538869 2018] [:warn] [pid 11711] mod_wsgi: Compiled for Python/3.6.2. [Mon Sep 17 03:26:32.538875 2018] [:warn] [pid 11711] mod_wsgi: Runtime using Python/3.6.5. [Mon Sep 17 03:26:32.541103 2018] [mpm_prefork:notice] [pid 11711] AH00163: Apache/2.4.33 (Amazon) mod_wsgi/3.5 Python/3.6.5 configured -- resuming normal operations [Mon Sep 17 03:26:32.541124 2018] [core:notice] [pid 11711] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND' [Mon Sep 17 03:26:35.694597 2018] [:error] [pid 11716] /opt/python/run/venv/local/lib/python3.6/site-packages/storages/backends/s3boto3.py:282: UserWarning: The default behavior of S3Boto3Storage is insecure and will change in django-storages 2.0. By default files and new buckets are saved with an ACL of 'public-read' (globally publicly readable). Version 2.0 will default to using the bucket's ACL. To opt into the new behavior set AWS_DEFAULT_ACL = None, otherwise to silence this warning explicitly set AWS_DEFAULT_ACL. [Mon Sep 17 03:26:35.694625 2018] [:error] [pid 11716] "The default behavior of S3Boto3Storage is insecure and will change " [Mon Sep 17 03:26:35.763182 2018] [:error] [pid 11716] /opt/python/run/venv/local/lib/python3.6/site-packages/storages/backends/s3boto3.py:282: UserWarning: The default behavior of S3Boto3Storage is insecure and will change in django-storages 2.0. By default files and new buckets are saved with an ACL of 'public-read' (globally publicly readable). Version 2.0 will default to using the bucket's ACL. To opt into the new behavior set AWS_DEFAULT_ACL = None, otherwise to silence this warning explicitly set AWS_DEFAULT_ACL. [Mon Sep 17 03:26:35.763199 2018] [:error] [pid 11716] "The default behavior of S3Boto3Storage is insecure and will change "
How can I fix this error?
The part caused by
django-storages
solved. But other part is still the same.[Mon Sep 17 06:44:13.104471 2018] [mpm_prefork:notice] [pid 18559] AH00169: caught SIGTERM, shutting down [Mon Sep 17 06:44:14.259136 2018] [suexec:notice] [pid 19102] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec) [Mon Sep 17 06:44:14.274950 2018] [so:warn] [pid 19102] AH01574: module wsgi_module is already loaded, skipping [Mon Sep 17 06:44:14.277045 2018] [http2:warn] [pid 19102] AH10034: The mpm module (prefork.c) is not supported by mod_http2. The mpm determines how things are processed in your server. HTTP/2 has more demands in this regard and the currently selected mpm will just not do. This is an advisory warning. Your server will continue to work, but the HTTP/2 protocol will be inactive. [Mon Sep 17 06:44:14.277059 2018] [http2:warn] [pid 19102] AH02951: mod_ssl does not seem to be enabled [Mon Sep 17 06:44:14.277619 2018] [lbmethod_heartbeat:notice] [pid 19102] AH02282: No slotmem from mod_heartmonitor [Mon Sep 17 06:44:14.277677 2018] [:warn] [pid 19102] mod_wsgi: Compiled for Python/3.6.2. [Mon Sep 17 06:44:14.277681 2018] [:warn] [pid 19102] mod_wsgi: Runtime using Python/3.6.5. [Mon Sep 17 06:44:14.279864 2018] [mpm_prefork:notice] [pid 19102] AH00163: Apache/2.4.33 (Amazon) mod_wsgi/3.5 Python/3.6.5 configured -- resuming normal operations [Mon Sep 17 06:44:14.279883 2018] [core:notice] [pid 19102] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
-
How to replace a color with another using GraphicsMagick Nodejs
I have an image with black background. I want to change it to have white background. Is that possible to achieve using GraphicsMagick in Nodejs?
I triedgm("test.png").fill("white")
but this didn't work for me.
I did some search and found there is a convert command but not sure there is equivalent function for it.gm.convert
ends up giving error. -
Error: Command failed: gm convert pdf-image conversion
I am trying to convert pdf to images in node.js app. For that I am using
pdf-image
npm module.I googled it and installed
pdf-image
npm module andgraphicsmagick
usingapt-get install graphicsmagick
in linux os.let pdfImage = new PDFImage("./file.pdf",{graphicsMagick: true,convertOptions: { "-resize": "2000x2000", "-quality": "75" }}); pdfImage.convertFile().then((imagePaths)=>{ console.log(imagePaths) cb(null,imagePaths) },(err)=>{ cb(err) });
In my local system its working fine and perfect. But when I deployed this to my
AWS ec2
instance and installed all required libraries but its throwing errorgm convert: Coder did not return an image (this is a bug, please report it!)
I am doing the same as local in ec2 instance but its not working.
-
What is best language to do a resize and optimization of images on the fly?
I'm setting up a new server to do management of all images of an website with huge traffic. At the moment we use a service like imgix and cloudinary, but the bill is too expensive.
So I would like to know what is better to do it. Node.js or PHP with GraphicsMagick or other better?
We want to do a lossless compression too on all images.