Response stringlengths 15 2k | Instruction stringlengths 37 2k | Prompt stringlengths 14 160 |
|---|---|---|
In your<VirtualHost *:80>Redirect permanent / https://ampletrails.comshould beRedirect permanent / https://ampletrails.com/ | http link of pagewhen redirect removes the / after the .comhttps link of page but without / after .comI am using VPS with apache and have following code in my .htaccess file.RewriteEngine On
# This will enable the Rewrite capabilities
RewriteCond %{HTTPS} !=on
# This checks to make sure the connection is not already HTTPS
RewriteRule (.*) https://%{SERVER_NAME}/$1 [R,L]
# This rule will redirect users from their original location, to the same location but using HTTPS.
# i.e. http://www.example.com/foo/ to https://www.example.com/foo/
# The leading slash is made optional so that this will work either in httpd.conf
# or .htaccess context | Redirect of http to https remove slash after .com apache |
7
Try Electric Fence. Its effect is global to your process' heap, but if your program accesses memory correctly it should not have any (unwanted) ill effect.
Share
Improve this answer
Follow
edited Nov 1, 2012 at 19:38
answered Dec 1, 2011 at 4:53
Brian CainBrian Cain
14.5k33 gold badges5151 silver badges8888 bronze badges
Add a comment
|
|
Is it possible to overload the new operator to allocate a bigger buffer with read-only memory on both sides to detect memory overflow, and how could I make that memory read-only?
linux + gcc
| How to lock a buffer which needs to be write-only? |
Solution-1:
Since the process.env expose all environment variables, so you can run
export MYCUSTOMENV=foo && npm run build
and the use process.env.MYCUSTOMENV in anywhere you want.
From vue doc: Only variables that start with VUE_APP_ will be statically embedded into the client bundle.
Solution-2
Use process.argv to get all argument, and filter what you want:
npm run build a=b foo
process.argv.forEach((val, index) => {
console.log(`${index}: ${val}`);
});
output:
0: /usr/local/bin/node
1: /Users/tzp/xxx/vue-cli-service
2: build
3: a=b
4: foo
|
Goal:
Pass an argument to be used during build time, to be able to use it in my .env.production file (or something that lets me use it as an environment variable if that's not possible).
.env.production file:
VUE_APP_CLIENT_ID=00-should-be-using-what-was-passed-by-command-00
Docker file:
#Inside my docker file
RUN npm run build #I need to pass the argument here
My package.json scripts are:
"scripts": {
"serve": "vue-cli-service serve --mode development",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"test:unit": "vue-cli-service test:unit"
},
Why:
OBS: I do use webpack, it's configured already by the vue-cli
I know I can configure different .env files and modes, but I need to be able to 'inject' or have a dynamic variable in my .env.production file as sometimes I build for production for different servers.
I could create even more files and that'd solve my problem but I want something more practical that that.
Context:
I'm using Docker and Auth0, and I'm actually using a VUE_APP_CLIENT_ID env variable that defines were it's going to tap for a request, I already have two different VUE_APP_CLIENT_ID definitions (one on .env.development one on .env.production) the thing is that I need to deploy the exact same up just in two different servers that each one target different client_id on production.
Tools:
Docker, docker-compose, Vue.js, vue-cli 3, npm
OS:
Ubuntu 16.04
| Pass an argument (command line) to be used by an .env.[mode] file, during build in Vue.js |
In the dusty corners of standard library, long forgotten by everyone, sits a class called valarray. Look it up and see if it suits your needs.
From manual page at cppreference.com:
std::valarray is the class for representing and manipulating arrays of values. It supports element-wise mathematical operations and various forms of generalized subscript operators, slicing and indirect access.
A code snippet for illustration:
#include <valarray>
#include <algorithm>
#include <iterator>
#include <iostream>
int main()
{
std::valarray<int> a { 1, 2, 3, 4, 5};
std::valarray<int> b = a;
std::valarray<int> c = a + b;
std::copy(begin(c), end(c),
std::ostream_iterator<int>(std::cout, " "));
}
Output: 2 4 6 8 10
|
Is there a preexisting library that will let me create array-like objects which have the following properties:
Run time size specification (chosen at instantition, not grown or shrunk afterwards)
Operators overloaded to perform element wise operations (i.e. c=a+b will result in a vector c with c[i]=a[i]+b[i] for all i, and similarly for *, -, /, etc)
A good set of functions which act elementwise, for example x=sqrt(vec) will have elements x[i]=sqrt(vec[i])
Provide "summarising" functions such as sum(vec), c0 etc
(Optional) Operations can be sent to a GPU for processing.
Basically something like the way arrays work in Fortran, with all of the implementation hidden. Currently I am using c1 from the STL and manually overloading the operators, but I feel like this is probably a solved problem.
| Element-wise operations in C++ |
You’re starting Sinatra in the development environment. When running in developmentSinatra only listens to requests from the local machine.There a few ways to change this, the simplest is probably to run in theproduction environment, e.g.:$ ruby myapp.rb -e productionYou could also explicitly set the bind variable if you wanted to keep running in development:set :bind, '0.0.0.0' # to listen on all interfacesShareFollowansweredSep 5, 2013 at 12:22mattmatt79k88 gold badges167167 silver badges198198 bronze badges2Awesome. the-e productionflag didn't work in my case but theset :bind, '0.0.0.0'opened access to the port 4567. Thank you!–alexhuang91Sep 5, 2013 at 17:211@user1296908 Are you usingmodular style? It doesn’t look like the command line flags work for modular style apps, only classic style. You can set theRACK_ENVenv variable from the command line if you want, modular apps will respect the setting then.–mattSep 5, 2013 at 17:54Add a comment| | I am trying to deploy a Ruby Sinatra api onto port 4567 of an EC2 micro instance.I have created a Security Group with the following rules (and created the instance with said security group):--------------------------------
| Ports | Protocol | Source |
--------------------------------
| 22 | tcp | 0.0.0.0/0 |
| 80 | tcp | 0.0.0.0/0 |
| 443 | tcp | 0.0.0.0/0 |
| 4567 | tcp | 0.0.0.0/0 |
--------------------------------I bound myapp.rb on port 4567 (the default, but for verbosity):set :port, 4567and ran the service:ruby myapp.rb
[2013-09-05 03:12:54] INFO WEBrick 1.3.1
[2013-09-05 03:12:54] INFO ruby 1.9.3 (2013-01-15) [x86_64-linux]
== Sinatra/1.4.3 has taken the stage on 4567 for development with backup from WEBrick
[2013-09-05 03:12:54] INFO WEBrick::HTTPServer#start: pid=1811 port=4567Usednmapwhile ssh'd in the EC2 instance on localhost:Starting Nmap 6.00 ( http://nmap.org ) at 2013-09-05 03:13 UTC
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00019s latency).
PORT STATE SERVICE
4567/tcp open tram
Nmap done: 1 IP address (1 host up) scanned in 0.08 secondsUsednmapwhile ssh'd in the EC2 instance on the external ip:Starting Nmap 6.00 ( http://nmap.org ) at 2013-09-05 03:15 UTC
Nmap scan report for <removed>
Host is up (0.0036s latency).
PORT STATE SERVICE
4567/tcp closed tram
Nmap done: 1 IP address (1 host up) scanned in 0.11 secondsHow do I change the state of the port from closed to open? | Sinatra EC2 Deployment Security Group Error |
its probably because the python process is doing something on exit thats eating ram. As a work around you can change grafana to a average ram usage across a time range to smooth out that spikeShareFollowansweredNov 19, 2021 at 13:54testfiletestfile2,29422 gold badges1313 silver badges3333 bronze badgesAdd a comment| | We have thispythonimage running a Sanic server with a simple entrypoint:ENTRYPOINT ["python3.9", "entrypoint.py"]All of our orchestration is managed by Kubernetes.Whenever a pod is deleted, the pod exits with a spike in memory usage, alerting our Grafana dashboardsHow can I debug this? | Pod exiting from Kubernetes causes spike in Pod memory usage |
You can use the below template"DNS": {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneId": "Z058101PST6709",
"Name": {
"Ref": "AlternateDomainNames"
},
"ResourceRecords": [{ "Fn::GetAtt": ["myDistribution", "DomainName"] }],
"TTL": "900",
"Type": "CNAME"
}
}I should raise as you're using Route 53 you should take advantage of usingAlias recordsinstead ofCNAMErecords for your CloudFront Distribution.This could be done via the below.{
"Type": "AWS::Route53::RecordSetGroup",
"Properties": {
"HostedZoneId": "Z058101PST6709",
"RecordSets": [{
"Name": {
"Ref": "AlternateDomainNames"
},
"Type": "A",
"AliasTarget": {
"HostedZoneId": "Z2FDTNDATAQYW2",
"DNSName": { "Fn::GetAtt": ["myDistribution", "DomainName"] }
}
}]
}
} | "DNS": {
"Type": "AWS::Route53::RecordSet",
"Properties": {
"HostedZoneId" : "Z058101PST6709",
"RecordSets" : [{
"Name" : {
"Ref": "AlternateDomainNames"
},
"Type" : "CNAME",
"TTL" : "900",
"ResourceRecords" : {
"Ref": "myDistribution"
},
"Weight" : "140"
}]
}
}Hi Team, I am going to create a route53 record with cloudfront please find the cloud-formation code and in which I am getting an error while create a stack. Basically I want to create a CNAME record by using cloudfront domain name. Please help me out in this. | Use Route53 template in cloudformation with Cloudfront |
just trying to clarify some things in your question :)Are you submitting a pull request to the upstream repo that you forked from, and wanting the upstream repo's Travis integration to build your code?If so, it may be that the upstream repo's maintainer doesn't have the "Build PR" setting turned on in Travis for their repo. You could ask them. Seethis questionfor more details. Or maybe your PR can't be merged, as described in theTravis docs.Or are you working on a branch within your own repo, which you forked from upstream?If so, you need to set up Travis integration yourself on your own forked repo. | i've a repo withmasterandbranch1. I'm writing test inbranch1with mocha / chai and i've changed the package json (forked a repo and maded some changes to it), but Travis seems to build still the old one, even if i changed my package.json. I've just forked and replaced the version in the package.json with the name of the repo (like everytime).Anyone have experienced something similar? I'm missing the right way to make Travis build the package.json that is in the Pull Request where i'm working? | CI - Using the right package.json while in other branch |
Websockets is not currently supported, we are working on adding it and I will update here when it is available.Thank youEdit: Websocket support is available in all regions, the annotation for it is:annotations:
ingress.bluemix.net/websocket-services: service-name | When the client tries to connect our ingress defined endpoint via awss://request, the app returns 400 bad request, which according to socket.io docs is due to missing headers removed by load balancing proxies like nginx.apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: my-ingress
annotations:
nginx.org/websocket-services: service-name
spec:
tls:
- hosts:
- www.myhost.com
rules:
- host: www.myhost.com
http:
paths:
- path: /
backend:
serviceName: service-name
servicePort: 80From the logs in the IBM provided ingress controller it seems to be a fork of thisnginx ingress controller. Which says that the annotationnginx.org/websocket-servicesadds support for websockets by adding directives to the generated nginx conf to pass the required headers. We have tried this as per above but to no avail.Has anyone had any success making this annotation work?
Any workarounds for adding to the generated nginx conf?Any IBM people know if this functionality was intentionally removed from the fork? And if there is any way to add support for websockets in the IBM version of Kubernetes? | How to add websocket support to an ingress resource in Kubernetes on IBM Bluemix? |
You can use a workaround like this:Create a Service with typeExternalNamein your namespace when you want to create an ingress:apiVersion: v1
kind: Service
metadata:
name: service-1
namespace: unversioned
spec:
type: ExternalName
externalName: service-1.service-1-ns.svc.cluster.local
ports:
- name: http
port: 8080
protocol: TCPCreate an ingress that point to this service:apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: traefik
name: ingress-to-other-ns
namespace: service-1-ns
spec:
rules:
- host: latest.example.com
http:
paths:
- backend:
serviceName: service-1
servicePort: 8080
path: / | Using Traefik as an ingress controller (on a kube cluster in GCP).
Is it possible to create an ingress rule that uses a backend service from a different namespace?We have a namespace for each of our "major" versions of code.1-service.com -> 1-service.com ingress in the 1-service ns -> 1-service svc in the same ns2-service.com -> 2-service.com ingress in the 2-service ns... and so onI also would like another ingress rule in the "unversioned" namespace that will route traffic to one of the major releases.service.com -> service.com ingress in the "service" ns -> X-service in the X-service namespaceI would like to keep major versions separate in k8s using versioned host names (1-service.com etc), but still have a "latest" that points to the latest of the releases.I believe voyager can do cross namespace ingress -> svc. can Traefik do the same?? | Route traffic to a service in a different namespace with Traefik and Kubernetes |
There was some security updates. You need to use TLS 1.2 for the sandbox (updates will need to be applied at a later date for Paypal in Live mode too).https://www.paypal-knowledge.com/infocenter/index?page=content&widgetview=true&id=FAQ1766&viewlocale=en_USHere's the roadmap and the different dates :Jan 14, 2016 After this date, Sandbox API endpoints only support new standard (HTTP/1.1, TLS 1.2 and SHA-256 certificates). This includes www.sandbox.paypal.com only accepting HTTPS for IPN Postbacks.Jan 31, 2016 Production starts issuing API Credential Certificates with new standard (2048-bit, SHA-256).Feb 29, 2016 Test Sandbox endpoints will be removed.Mar 17, 2016 New SFTP IP addresses add to DNS for reports.paypal.com.Apr 14, 2016 Old SFTP IP addresses removed from DNS for reports.paypal.com.May 12, 2016 Old SFTP IP addresses stop working.Jun 17, 2016 After this date, Production API endpoints will start moving to the new standard (HTTP/1.1, TLS 1.2 and SHA-256 certificates)Sep 30, 2016 IPN postbacks to www.paypal.com only allow HTTPSJan 1, 2018 All Certificate API Credentials must have been upgraded to the new standard. | I am using paypal sandbox account for my java application and hosting using centos 6.7. While I am running the application I am getting error for communicating with paypal account.I am getting the error as followed,javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Alerts.java:192)
at sun.security.ssl.Alerts.getSSLException(Alerts.java:154)
at sun.security.ssl.SSLSocketImpl.recvAlert(SSLSocketImpl.java:1961)
at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1077)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)
at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)
at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:515)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:338) | Getting ssl handshake error while communicating with paypal server in my java application |
In my particular case, I was working with Docker for Windows from Edge channel. So I just uninstalled it and installed the latest release from Stable channelhttps://docs.docker.com/docker-for-windows/install/#download-docker-for-windows. It worked out and the problem went away. | I have trying to execute a newly asp net core project from inside visual studio 2017, but always get this error:Build path either does not exists, is not accesible, or is not a valid
URLAny idea what the problem is? | Visual studio 2017 docker error running app |
Yes, they should have the same password. | I'll preface this with the statement that I hate using these Amazon servers.Ok what I need to know is how to find the password for a specific Amazon RDS instance. I have a live instance running my store and working on setting up a development copy. So I lauched a copy of the DB but can't seem to find the password for this new DB instance anywhere.I created a Snapshot, then restored from the snapshot just with a new instance identifier. So would the passwords be the same on both instances?Thanks! | Amazon RDS Instance Password? |
3
Git branch names are ephemeral. You can delete the branch name and it's gone. (The commits themselves are a different question as they are independent of the branch name.)
GitHub Pull Requests are permanent. They are not in Git, they are in GitHub. They are stored in a database that you cannot change. The only thing you can do here is contact GitHub support.
Share
Improve this answer
Follow
answered Sep 5, 2022 at 7:37
torektorek
465k6363 gold badges682682 silver badges817817 bronze badges
Add a comment
|
|
I mistakenly named a branch and pushed it to Github, even opened the pull request.
Now I want to rename the branch like this, But if I do, it will delete the old branch and create a new one with the correct name. The issue is, that I don't want the owner of the repo to see that I have deleted a branch. I completely want the branch with the wrong name gone from git history.
Is there any other way I can achieve this? I don't want to lose the code too. Please help me with this, I have searched a lot but couldn't find a related solution to my problem. Thanks
| How do I modify a GitHub pull request so that the pull request cannot be seen? |
A kmem_cache consists of 1 or more slabs.
A slab consists of 1 or more contiguous pages.
So when you call kmem_cache_alloc, it returns you a piece of memory in a slab which consists of 1 or more contiguous pages.
But if you call kmem_cache_alloc twice, the 2 pieces of memory you get may not contiguous.
And kmem_cache_create only creates and initializes the data structure for a kmem_cache and do not allocate the memories.
|
Am I right assuming that a memory slab created and allocated with kmem_cache_create and kmem_cache_alloc is contiguous?
| kmem_cache_* creates contiguous memory? |
There is very nice project which I found and now I can solved my problem.I used dockprom which created by stefan you can visit thisgithub link.These are streps that I used:I use one server as a master (I deploy dockprom project on this server).There are two ways to monitor another server by using this project;You can only deploy cadvisor and nodeexporter containers on another
server then connect to prometheus master, but you need to add some configurations.The second way which I used was more simple, I deploy dockprom to
all servers then I added datasource on master server (I filled the
data source IP with IP server which I want to monitor plus
prometheus port). | I am new in prometheus.I want to monitor all docker containers inside many servers.
The case is like this:I have 3 servers -> server A, B, and C (all running with Ubuntu).Each server has many docker containers for difference project.I will add one server (server D) and I want to install Prometheus on
this server.My questions:is it possible, If I want to install Prometheus to server D and
monitor all docker containers in server A, B, and C?is it possible if I want to monitor all containers sorted by
project? for example I use Gravana dashborad. Can I have one gravana
dashboard for each project? | Prometheus for monitoring docker containers on multi servers |
From the documentation to setup a custom domain:
Warning: Project pages subpaths like
http://username.github.io/projectname will not be redirected to a
project's custom domain.
This means that due to the relative paths you can either have the assets on your username.github.io/project-name or on your custom domain.
If you want them in the github one check what the documentation says about the baseurl configuration, it's at the bottom of the page, in the "Project Url Structure". It's simple you just need to add a
baseurl: /project-name
row to your _config.yml and use the {{ baseurl }} tag in your permalinks, jekyll will do the substitutions. And to test it locally just run the server with this option
jekyll serve --baseurl ''
Hope it helps :) Happy coding!
|
I have created a website and am trying to host it on git hub pages. My site is available at -
http://<username>.github.io/<project name>/
But the static files for my site are available at the following path -
http://<username>.github.io/css/site.css
http://<username>.github.io/script/main.js
The above path omits the <project name>
So whenever I hit the url my static files are not loaded.
Is there a way to make it work with the github url?
Note: When I use a custom domain everything works fine because the relative paths are fine in that case.
Temporary Solution
I have created a User page instead of a Project page to overcome this issue.
| Static resources not loading on GitHub Pages |
You probably need to specify path to CUDA:
export C_INCLUDE_PATH=${CUDA_HOME}/include:${C_INCLUDE_PATH}
export LIBRARY_PATH=${CUDA_HOME}/lib64:$LIBRARY_PATH
Please make sure that echo ${CUDA_HOME} does provide some sensible output.
|
when I install pycuda by this instruction:
pip install pycuda
but there is an error:
src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory
but I have installed the cuda toolkit.this is the result of nvcc -V
[root@localhost include]# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Tue_Jun_12_23:07:04_CDT_2018
Cuda compilation tools, release 9.2, V9.2.148
this is the result of install rpm downloaded in https://developer.nvidia.com/cuda-downloads
[root@localhost include]# sudo dnf install cuda
Last metadata expiration check: 0:05:09 ago on Wed 05 Sep 2018 10:08:35 PM EDT.
Package cuda-1:9.2.148.1-2.fc28.x86_64 is already installed, skipping.
Dependencies resolved.
Nothing to do.
Complete!
| src/cpp/cuda.hpp:14:10: fatal error: cuda.h: No such file or directory |
I askedandymccurdy, the author of redis-py, on github andthe answeris as below:If you're using redis-py<=2.9.1, socket_timeout is both the timeout
for socket connection and the timeout for reading/writing to the
socket. I pushed a change recently (465e74d) that introduces a new
option, socket_connect_timeout. This allows you to specify different
timeout values for socket.connect() differently from
socket.send/socket.recv(). This change will be included in 2.10 which
is set to be released later this week.The redis-py version is 2.6.7, so it's both the timeout for socket connection and the timeout for reading/writing to the socket. | In the code below, is the pipeline timeout 2 seconds?client = redis.StrictRedis(host=host, port=port, db=0, socket_timeout=2)
pipe = client.pipeline(transaction=False)
for name in namelist:
key = "%s-%s-%s-%s" % (key_sub1, key_sub2, name, key_sub3)
pipe.smembers(key)
pipe.execute()In the redis, there are a lot of members in the set "key". It always return the error as below with the code last:error Error while reading from socket: ('timed out',)If I modify the socket_timeout value to 10, it returns ok.Doesn't the param "socket_timeout" mean connection timeout? But it looks like response timeout.The redis-py version is 2.6.7. | How to set the redis timeout waiting for the response with pipeline in redis-py? |
The error message indicates that there is another container relying on the same image. It could be that a separate docker container provisioned outside of terraform and using the same nginx docker image in the tutorial. Check your docker ps -a to see if there is such container if so just run docker rm -f <container_name>to remove it and your terraform destroy should work.
|
I was following a tutorial on terraform.io that has me provision a docker image and container using terraform, and then destroy the terraform stack. However, I get the following error:
Error: Unable to remove Docker image:
Error response from daemon: conflict: unable to delete 540a289bab6c (must be forced) -
image is being used by stopped container ae12197d265d
I know the native Docker solution to this is just running docker rmi -f 540a289bab6c. However, I was wondering if there's a terraform approach to this?
The docs for the terraform resource docker_image show the reason terraform attempted to destroy the image upon terraform destroy: the template main.tf had keep-locally set to true. But it doesn't say how to force that destruction.
The main.tf from the tutorial is as follows:
terraform {
required_providers {
docker = {
source = "terraform-providers/docker"
}
}
}
provider "docker" {}
resource "docker_image" "nginx" {
name = "nginx:latest"
keep_locally = false
}
resource "docker_container" "nginx" {
image = docker_image.nginx.latest
name = "tutorial"
ports {
internal = 80
external = 8000
}
}
So how do I force terraform destroy to work on this template without resorting to manual intervention using docker native tools?
| How to force delete Docker image with terraform destroy |
Using the full path is defintely better then first using cd. To get the result of the cronjob, you could just output to file like this:59 * * * * /home/sansal/Scripts/usbreset /dev/bus/usb/002/003 &>> /home/sansal/usbreset.log | I need to run a task every hour . I first change directory to the path where script is and then operate that script. So I try to use a cron job as :59 * * * * cd /home/sansal/Scripts && sudo ./usbreset /dev/bus/usb/002/003I added that line to crontab. But I cant make sure if it is true. And I dont see any output in terminal about that. | Run two commands in cron |
Grafana is a visualization tool that can be set on top of a datastore such as Prometheus / ADX etc. You have first enable collection of these metrics into such a datastore.Here is one such examplehttps://github.com/wizenoze/storm-metrics-reporter-prometheusOnce this is done , any metrics that are reported from the code (Counter , Gauges , JMX metrics) are then saved on the data store that can then be visualized on Grafana | I am collecting data in JSON format that I process in real time with apache storm. I would now like to use grafana to be able to perform real time visualizations on this processed data. Is there a way to connect storm to grafana?
I haven't found much information on the topic, any help would be appreciated | How to connect apache storm with grafana? |
add to to your docker fileRUN \
apt-get update && \
apt-get install -y software-properties-common && \
echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && \
add-apt-repository -y ppa:webupd8team/java && \
apt-get update && \
apt-get install -y oracle-java9-installer && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk8-installer
ENV JAVA_HOME /usr/lib/jvm/java-9-oracleShareFollowansweredApr 10, 2018 at 0:15Salvatore NapoliSalvatore Napoli43433 silver badges99 bronze badges11E: Package 'oracle-java9-installer' has no installation candidate ERROR: Service 'app' failed to build: The command '/bin/sh -c apt-get update && apt-get install -y software-properties-common && echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | debconf-set-selections && add-apt-repository -y ppa:webupd8team/java && apt-get update && apt-get install -y oracle-java9-installer && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/oracle-jdk8-installer' returned a non-zero code: 100–Peter WeyandSep 10, 2018 at 20:16Add a comment| | I currently have a docker container with an Ubuntu(17.10) image installed with other packages included. However, I'm currently having difficulty trying to install Java onto this container in addition to the current image.Current Dockerfile :FROM cityofzion/neo-privatenet
ADD files/ files/
ENTRYPOINT [ "/bin/bash" ]When trying to find information on how to do this and testing inside of the container most suggest using this command:apt-get install -y oracle-java9-installerHowever this results in:E: Unable to locate package oracle-java9-installerI have also tried this suggested commandwget http://download.java.net/java/GA/jdk9/9/binaries/jdk-9+181_linux-x64_bin.tar.gzWhich produces this resultHTTP request sent, awaiting response...
404 Not Found - ERROR 404: Not Found.I have only tried running these commands in the container, since that is how they would be run and they seem to be failing.Can anyone suggest what I can include into my Dockerfile that install java onto my image?Thanks in advance. | How do I put Java onto a Ubuntu docker container? |
When you changed your username, the URL to the repository changed as well. When you now try to push, it is pushing to a repository that does not exist anymore.The way to fix this is to point your local repository to the correct remote one:git remote rename origin origin-backup
git remote add origin <[email protected]/new-username/repository>Afterwards, you should be able to push again. | When I changed my username on github my git bash can't recognize that it is my account so when I try to push changes to my remote repos on github it gives me error that I do not have rights to edit them. Please help I need to get the files in the remote repo into the git bash. | Git can't have access rights to edit the remote repository |
From the command line, you can usegit pullto get any changes made in another repository. There are GUI tools to do the same thing, but I'm not familiar with many of them. If you are developing in an IDE, it will have either built-in support for this and many other git commands or a plugin which you can install.To get the commits from the pull request, you will first need to usegit remote addto add the other repository as a remote. Then you can usegit pullto pull any commits from the other repository.I have purposely left out the details for how these commands work. I suggest you usegit helpto learn more about these commands. The help pages are a very valuable resource which you should familiarize yourself with. | On one of my pull request, I clicked the 'update branch' button. Now this made a new merge master to branch commit on github and not on local. How can I get that commit from my PR so that I can squash it? | How can I retrieve a commit made on github to my local repo? |
It sounds fine. You have a singleton object, meaning that once created it will persist for the lifetime of the app. To accompany it, you have a timer that will also persist for the lifetime of the app. So once you have ensured their persistence (i.e. they are both retained), there is no memory to manage. They will both live as long as the app does and in this case that is exactly what you want. The fact that there is a retaincyclein the story (because of NSTimer's peculiarities) is, as your question implies, almost secondary.ShareFolloweditedMar 30, 2014 at 0:32answeredMar 29, 2014 at 21:32mattmatt523k8989 gold badges901901 silver badges1.2k1.2k bronze badges1@JoshCaswell Good point. I'll edit to "live as long as the app does".–mattMar 30, 2014 at 0:32Add a comment| | Say I have an object that should exist as a singleton for the whole life of the app. Is it okay for this object to contain, say, a strong reference to anNSTimerwith itself as the timer's target? This will be a retain cycle, but I don't see any downside. When the OS tries to free memory, it doesn't necessary calldeallocanyway. | Are retain cycles okay sometimes? |
We faced a similar issue with a client who needed our IP address to be whitelisted. We solved the issue by:Spinning up a Compute Engine with a static IP address. This is the IP address we gave to our clientInstalled Squid on the compute engine (https://help.ubuntu.com/lts/serverguide/squid.html)We then redirected all calls from the App Engine through the proxy server. You didn't list what language you are using but for PHP, that meant adding the following two lines to our CURL operations:curl_setopt($ch, CURLOPT_PROXY, "http://" . $_SERVER['SQUID_PROXY_HOST'] . ":" . $_SERVER['SQUID_PROXY_PORT'] );curl_setopt($ch, CURLOPT_PROXYUSERPWD, $_SERVER['SQUID_PROXY_USER'] . ":" . $_SERVER['SQUID_PROXY_PWD']);One thing to note is that depending on the number of calls you are making, a micro instance might not work for you. We initially setup our proxy server on a micro box but were having to restart it every few days. We ended up switching to a standard box and have not run into any problems since. | I have a Java web app on Google App Engine which makes requests to an external API. The API recently requires the whitelisting of IP addresses in order to access its services. Because GAE does not offer static IPs, I understand that one solution is to set up GCE instance (with a static IP) and use it as a proxy for external requests made by the GAE app.I have set up a f1-micro instance with Debian GNU/Linux 9, and have created a static external IP address as perthe documentation.How do I install nginx and set up GAE to route requests to the GCE proxy? | Using Google Compute Engine as a proxy for a Google App Engine web app |
Although my user has Administrator privileges, I don't need to use an elevated PowerShell to run docker.
You can try making the connection via TCP. In Power Shell type:
$env:DOCKER_HOST="tcp://0.0.0.0:2375"
docker ps
Or
$env:DOCKER_HOST="tcp://localhost:2375"
docker ps
Since version 17.03.1-ce-win12 (12058) you must check Expose daemon on tcp://localhost:2375 without TLS if you use Docker for Windows and connecting via TCP
Regards
|
I have installed docker for Windows 10 (Anniversary) as per MSDN
I can execute docker.exe commands in an elevated powershell environment, but not in a regular powershell.
I have updated the docker configuration file to contain:
{
"group": "Power Users"
}
And have obviously added the user to power users, the user is also in the administrators group.
Is there any way to execute docker commands such as docker search * without using run as administrator
Warning: failed to get default registry endpoint from daemon (error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.25/info: open //./pipe/docker_engine: Access is denied.). Using system default: https://index.docker.io/v1/
error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.25/images/search?limit=25&term=%2A: open //./pipe/docker_engine: Access is denied.
| Docker for Windows 10 //./pipe/docker_engine: access is denied |
Well, the easiest way is for sure :Correct what Sonar is saying:)but let's assume that it's false positive.Here are the list of possible method to fix this issue :Since November 2014 :tag support// NOSONAR
the code who display Sonar erroris now fully supported by the JavaScript check (thanks @RPallas)When you don't control the Sonar :quite ugly methodtry {
the code who display Sonar error
} catch(err) { }If you catch any possible problem, Sonar can't detect something (thanks @JavaScript).But the best way is for sure to modify the configuration of Sonar :When you control Sonar :add a pluginTo use the CheckStyle plugin on Sonar : (http://checkstyle.sourceforge.net/)The solution will be to add a Checkstyle structured comment to the offending class to suppress a particular check.The suppression comment (SuppressionCommentFilter) format required is like this://CHECKSTYLE:OFF
the code who display Sonar error
//CHECKSTYLE:ONBut I send you to the documentation of this plugin (http://checkstyle.sourceforge.net/config.html)I hope this answer helps.ShareFolloweditedMay 23, 2017 at 10:29CommunityBot111 silver badgeansweredJul 9, 2015 at 14:30Valentin MontmirailValentin Montmirail2,62411 gold badge2525 silver badges5757 bronze badges1'correct what Sonar is saying' is off topic, and try/catch is a wrong answer. The direct simple answer below is just better.–Oleg MihailikJul 20, 2023 at 10:40Add a comment| | I am currently running Sonar for the static analysis of my code. When I was analyzing java files and wanted to suppress a certain warning, I used the @SuppressWarnings(nameOfTheWarningOnSonar) annotation. I wanted to know if there was a simple equivalent in Javascript to suppress specific warnings on Sonar. | Javascript equivalent of @SuppressWarnings? |
The following two things are possible:A. May be given client already disconnected from KafkaB. May be this metric is not present on broker. It might be visible in the JVM application which is running the consumer code. I am not sure but here is how you can check:Restart your consumer application with JMX enabledUse visual vm to connect to the above jvmIt should show all the available JMX metrics.If the metrics contain metrics of your choice then you were looking at wrong place (broker). If not then I am wrong. | I try to export Kafka metrics per JMX to Prometheus and display them with Grafana, but I´m struggling to get the Consumer metrics (to be more precise this one:kafka.consumer:type=ConsumerFetcherManager,name=MaxLag,clientId=([-.\w]+) )Everytime I try to fetch this Mbean, it doesn´t even show up. I read all the time that I have to "look into the client", or "I´m looking in the broker metrics, but I need the consumer metrics", but nobody does explain how to do this, so I´m asking you guys if you could help me. Is there some kind of configuration, or special JMX Port to get Consumer metrics or something like that?The pattern for my config file to look for MBeans:- pattern : kafka.consumer<type=(.+), name=(.+), client-id=(.+)><>(Count|Value)
name: kafka_consumer_$1_$2
Labels:
clientId: "$3"Also, i need to fetch the Metrics with JMX, because i dont have access to the Kafka server.I´m using this project as an example:https://github.com/rama-nallamilli/kafka-prometheus-monitoring | Monitor Kafka Consumer Metrics with JMX |
Your website's HTML is trying to access a url that is not /test/** but /platform/images/leaves.png this means that NGINX won't try to use the reverse proxy.
This part of your NGINX configuration is not getting used at all for anything but /test/**, and NGINX is searching on the local disk of the webserver for the files, which do not exist.
try using a config which captures all scopes instead of just /test.
server {
listen 80;
location /platform {
proxy_pass https://10.10.10.10/platform/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect https://10.10.10.10/ /;
}
}
your website should be visible from http://{NGINX server}/platform/login
this will change your end-point's url so you could add an exception for /test to make http://{NGINX server}/test work aswell.
server {
listen 80;
location /platform {
proxy_pass https://10.10.10.10/platform/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect https://10.10.10.10/ /;
}
location /test {
proxy_pass https://10.10.10.10/platform/login;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect https://10.10.10.10/ /;
}
}
You could also edit your HTML page and proxy_pass /test/** to https://10.10.10.10/platform/
your problem is further explained in Nginx defaults to /usr/share/nginx/html
|
I've configured a reverse proxy, and while the http loads, the css/images of the login page don't load. It is trying to load them from the localhost and not the upstream server
I've tried multiple proxy_redirects and rewrites (although I'm fairly new at this) and can't seem to get it working.
server {
listen 80;
location /test {
proxy_pass https://10.10.10.10/platform/login;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_redirect https://10.10.10.10/ /;
}
}
Log error:
[error] 26072#0: *127 open() "/usr/share/nginx/html/platform/images/leaves.png" failed (2: No such file or directory), client: 127.0.0.1, server: , request: "GET /platform/images/leaves.png HTTP/1.1", host: "localhost", referrer: "http://localhost/test"
When I inspect element on chrome it returns 404's for all css/images as well.
Please Help
| Can't get nginx reverse proxy to load css/images of web application |
Like Amazon EMR Documentation says, you can create a cluster to run some script my_script.sh on the master instance in a step:
aws emr create-cluster --name "Test cluster" --ami-version 3.11 --use-default-roles
--ec2-attributes KeyName=myKey --instance-type m3.xlarge --instance count 3
--steps Type=CUSTOM_JAR,Name=CustomJAR,ActionOnFailure=CONTINUE,Jar=s3://elasticmapreduce/libs/script-runner/script-runner.jar,Args=["s3://mybucket/script-path/my_script.sh"]
my_script.sh should look something like this:
#!/usr/bin/env bash
hadoop jar my_first_step.jar [mainClass] args... &
hadoop jar my_second_step.jar [mainClass] args... &
.
.
.
wait
This way, multiple jobs are submitted to Hadoop in the same step---but unfortunately, the EMR interface won't be able to track them. To do this, you should use the Hadoop web interfaces as shown here, or simply ssh to the master instance and explore with mapred job.
|
Amazon EMR Documentation to add steps to cluster says that a single Elastic MapReduce step can submit several jobs to Hadoop. However, Amazon EMR Documentation for Step configuration suggests that a single step can accommodate just one execution of hadoop-streaming.jar (that is, HadoopJarStep is a HadoopJarStepConfig rather than an array of HadoopJarStepConfigs).
What is the proper syntax for submitting several jobs to Hadoop in a step?
| How do I submit more than one job to Hadoop in a step using the Elastic MapReduce API? |
The virtual memory address space of each process is divided into virtual memory areas (VMAs) where all the memory in one VMA is contiguous and shares certain properties such as permissions. For example, a process might have one VMA for its code, one VMA for each type of data, one VMA for each distinct memory mapping (if any), etc.
Each VMA consists of a number of pages, where a page is the unit for moving between main physical memory and backing store.
Each page has an entry in the Page Table, to indicate whether the page is currently in physical memory (in which case it points to the physical memory address of the page) or currently “paged out” on the system’s backing storage (in which case it points to the backing storage address of the page copy).
So each VMA has multiple PTEs.
The function of the VMA is to define a contiguous area of virtual memory (contiguous virtual addresses, not contiguous physical addresses) with the correct permissions.
The function of the Page Table is to manage paging between main physical memory and backing store, and to be the communication point between the system/hardware (the MMU) and the OS software.
|
What is the difference between objects VMA (Virtual Memory Area: struct vm_area_struct, with which operates the kernel Linux) and PTE (Page Table Entry, with which operates MMU), and why we require VMA and not enough PTE?
| What is the difference between objects VMA (Virtual Memory Area:) and PTE (Page Table Entry)? |
: Make sure first that you have certificates installed on your Debian in/etc/ssl/certs.If not, reinstall them:sudo apt-get install --reinstall ca-certificatesSince thatpackage does not includerootcertificates, add:sudo mkdir /usr/local/share/ca-certificates/cacert.org
sudo wget -P /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt
sudo update-ca-certificatesMake sure your git does reference those CA:git config --global http.sslCAinfo /etc/ssl/certs/ca-certificates.crtJason Cmentions another potential cause (in the comments):It was the clock. The NTP server was down, the system clock wasn't set properly, I didn't notice or think to check initially, and the incorrect time was causing verification to fail.Certificates are time-sensitive.dopamaneconfirms inthe comments:This was the issue for me on WSL.Ransudo hwclock -s, and I could successfully clone the submodule.2022:Auspexadds inthe comments:ca-certificates does indeed contain root certificates.It doesn't contain the CAcert root certificates.This might have been a good answer 6 1/2 years ago, but those certificates were suspect way back then and haven't improved.There's a reason they're not in theca-certificatespackage.These days we haveLetsEncrypt, so everyone has certificates with reliable auditing and nobody needs to rely on CAcert. | I just created a github account and a repository therein, but when trying to create a local working copy using the recommende url viagit clone https://github.com/<user>/<project>.gitI get an error likefatal: unable to access 'https://github.com/<user>/<project>.git': server certificate verification failed. CAfile: /home/<user>/.ssl/trusted.pem CRLfile: noneI'm on Debian Jessie, and I would have expected both Debian and GitHub to provide / rely on a selection of commonly accepted CAs, but apparently my system doesn't trust GibHub's certificate.Any simple way to fix this (without the frequently recommended "GIT_SSL_NO_VERIFY=true" hack and similar work-arounds)?EDIT:Additional information:The ca-certificate package is installed.Installing cacert.org's certificates as
suggested by @VonC didn't change anything.My personal ~/.ssl/trusted.pem file does contain a couple of entries, but to be
honest, I don't remember where the added certificates came from...When removing ~/.ssl/trusted.pem, the git error message changes tofatal: unable to access 'https://github.com/tcrass/scans2jpg.git/': Problem with the SSL CA cert (path? access rights?) | github: server certificate verification failed |
Have you looked at BasicAWSCredentials?BasicAWSCredentials credentials = new BasicAWSCredentials(accessKeyId, secretKey);
AmazonSimpleDB mDB = new AmazonSimpleDBClient(credentials);You can load accessKeyId and secretKey through the use of Properties.ShareFollowansweredFeb 8, 2011 at 22:57RyanRyan39222 silver badges1111 bronze badgesAdd a comment| | I'm using Java.
Instead of usingAmazonSimpleDB sdb = new AmazonSimpleDBClient(new PropertiesCredentials(
new File("/AwsCredentials.properties")));is there anyway to store the credential information (the accesskey and secretkey) in the program; something likeAmazonSimpleDB sdb = new AmazonSimpleDBClient("acesskey","secretkey");It seems like this function does not exist. | Simple DB accessing |
The error message seems to be self-explanatory. Self-signed SSL certificates always cause security warnings/errors. You will either need to add your self-signed SSL as an exception or add the self-signed CA to OS trusted certificates pool.You may also try using something identical to--insecureoption incurl.ShareFollowansweredMar 15, 2020 at 19:00iddqdiddqdiddqdiddqd3122 silver badges55 bronze badgesAdd a comment| | I'm trying to send aGET requestto a host with (supposedly) correct certificates.It's a university task, and they gave me these certificates. (which are only valid for 30 seconds)But the code below gives me the error thatcertificate verify failed: self signed certificateThe package I got from the host in response says thatFatal Error: Unknown CA.What could cause the issue? Thanks!context = ssl.SSLContext(ssl.PROTOCOL_TLSv1_2)
context.load_cert_chain('clientcert.pem', keyfile='clientkey.pem')
connection = http.client.HTTPSConnection(IP)
connection.request("GET", "/")
response = connection.getresponse()
print("response:", response) | Can't send GET to HTTPS service with cert, error: certificate verify failed: self signed certificate |
Get an answer here :https://community.sonarsource.com/t/sonarqube-configure-pull-request-decoration-with-parameters/18999No, this is not possible to define this from the scanner. Thoses are
project-level parameters, they won’t change from one analysis to the
next one, so better not pollute your scanner with static parameters.You can indeed define them with the rest API. Have a look at the
api/alm_settings/set_bitbucket_binding entry in your web api
documentation!ShareFollowansweredJan 22, 2020 at 11:04Jean-Baptiste MartinJean-Baptiste Martin85199 silver badges3131 bronze badgesAdd a comment| | I'm using SonarQube 8.1 (Developer Edition) and Jenkins to analyse Maven projects which source code is hosted on Bitbucket.I'm using the "Pull Request Decoration" functionality and it's working well. However, to configure this functionality, I had to set these parametersmanually(through the GUI, in project page :Administration>General Settings>Pull Request Decoration) :Configuration nameProject keyRepository SLUGIs it possible to set these parameters through command line (e.g inmvncommand, I'd expect something likemvn clean -Psonar $SONAR_MAVEN_GOAL -Dsonar.pullrequest.decoration.configurationname=<my-conf-name> -Dsonar.pullrequest.decoration.projectkey=<my-project-key> -Dsonar.pullrequest.decoration.repositoryslug=<my-repository-slug>) or throught REST API ? | SonarQube - Configure Pull Request decoration with parameters |
I believe but have not confirmed or tested that you can use the session library methodgc($maxlifetime)to accomplish your goal. Every driver for the CI session class must define this method so it doesn't matter if you're using files, database, or any of the other flavors."gc" stands for Garbage Collector and it will delete all session data older than the current time minus $maxlifetime. Passing a$maxlifetimevalue of 0 (zero) should delete all sessions created before the currenttime().So, create a simple controller that loads thesessionlibrary and run this line of code.$this->session->gc(0);All the required looping and other business in handled for you.ShareFolloweditedAug 9, 2019 at 22:13answeredAug 9, 2019 at 21:59DFriendDFriend8,89911 gold badge1414 silver badges2626 bronze badgesAdd a comment| | I have a CodeIgniter platform where I want to log out users via cron daily due to inactivityBackground:I want to do this via Cron, because I'm assuming that if it's just AJAX or php then it might not work as a request would need to be made in order to trigger the log out.I only want to do a logout every day.I've been tinkering with CodeIgniter's session methods, but I'm failing to see how I can both loop through users and target them based off of session data.I Have some rudimentary code below$users_sql = "SELECT * FROM `users`";
$users_result = $this->db->query($users_sql)->result();
foreach($users_result as $user){
$this->session->set_userdata("user_id",$user->id); //set user id
$user_session_data = $this->session->userdata('last_activity'); // Do I need to have some kind of additional cookie here?
// Check last session stuff and logout if either midnight and no activity
}Any help pointing me in the right direction would be very much appreciated! | CodeIgniter: Looping through Users to Log-out Inactive Users Based on Session via Cron |
RewriteRule ^site/second/files/(.*)$ http://example-two.com/media1/$1 [L] | Anyone here knows how to do this on .htaccess? I need to replace the part of URL that is inside the "[]".Here is the URL:[http://example.com/site/second/files/]2012/08/Image.jpgwith this new URL:[http://example-two.com/media1/]2012/08/Image.jpgThanks in advance! | .htaccess replace part of URL |
By default, DescribeInstanceStatus only captures instances that are running. You can set the propertyIncludeAllInstancesin the request to true to change this. From the documentation:IncludeAllInstancesWhen true, includes the health status for all instances. When false,
includes the health status for running instances only.Default: falseCode example:DescribeInstanceStatusRequest rr = new DescribeInstanceStatusRequest()
{
IncludeAllInstances = true
};Reference:AWS Documentation - DescribeInstanceStatusRequest | In the AWS console, you can see what instances are online, what are shutting down, and what are shut down. I'm trying to replicate this functionality in my application, but EC2 api doesn't seem to cooperate.Here's what I'm doing:DescribeInstanceStatusRequest rr=new DescribeInstanceStatusRequest();
rr.InstanceIds=new List<string>(new[]{instanceId});
var status = ec2.DescribeInstanceStatus(rr);
List<InstanceStatus> statusses = new List<InstanceStatus>();
foreach (var s in status.InstanceStatuses)
{
if (s.InstanceId == instanceId)
{
statusses.Add(s);
}
}
if (statusses.Any())
{
var instanceStatus = statusses.First();
...
}This works fine when the instance is online, but as soon as I request to shut it down, the instance disappears from the info.How do I get info for all instances, including those shutting down, shut down and terminated ones? | How to use EC2 api to tell instance status? |
You should look at thewaitFormethod, where you need to pass the job id and you can set event callback like thisvar params = {
Id: 'STRING_VALUE' /* required */
};
elastictranscoder.waitFor('jobComplete', params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(data); // successful response
}); | I'm doing a CMS site with node.js, for handle the user posted video, I decided to employ the amazon's Elastic Transcoder service.
I already figured out how to create a job and transcode the video with aws-sdk for node.js, but one issue still stucking me.My site also handle user posted pictures, after received their post, I will display a preview of the picture, and waiting for user confrim.
I can do this beacuse I got notified (in the callback) after the picture actually stroed on server(aws s3), then response user with the location of it.Just like handle picture, I want display a preview of the video that user posted, but this case seems different, the transcoding is time consuming and happend in the cloud
I don't know how to get notified when the job's status changed. (progress, finished, error etc. I want display those info to user)According to the aws docs and manual, the job will send notification through the aws SNS, does it mean that I must subscribe the SNS manually after I created the job? That's over complicated I think.is there any better solution for this? thanks. | How to get notified of aws transcoder job status |
Cron processes only run for a short time and then stop, they do not run continuously. If your cron process updates the file correctly, then it ran correctly. | I've setup my project and a cron file inside an openshift box, the project runs ok, but for some reason I can't manage cron running processes, I can't even list them, if I connect via ssh and exec 'ps aux' the cron process doesnt even appear.I write a little test:<?php
file_put_contents('../../b.log','pid: '.getmypid().PHP_EOL,FILE_APPEND);
file_put_contents('../../b.log',shell_exec('whoami'),FILE_APPEND);cat b.log:pid: 194061
54ae4f424382ec439100xxxx //the user is right, the cron process is running behind the same userwhoami from ssh spits the same user, but if I try to reach the process I get:ls /proc/194061
ls: no se puede acceder a /proc/194061: Permiso denegado //Permission deniedthe process exists because /proc/19406[TAB] completes and I see the log files populating but I cant check if the process is really running or not via ssh or via web :S | Openshift: manage cron processes |
A recent update of PAM broke cron. Try restarting your computer (or restarting cron withsudo /etc/init.d/cron restart) | I have a python script "start.py" that executes well from the command line. There is only one statement in it (print "hello"). EDIT: start.py contains also a working interpreter directive in the first line.As soon as I run the script from a cron job, every time it fires there is a message in syslog:Jun 7 02:57:01 mit CRON[23275]: Module is unknownI tried already to add PATH and PYTHONPATH information to the cron file:$ cat /etc/cron.d/my_cron
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PYTHONPATH=/usr/lib/python2.6:/usr/lib/python2.6/plat-linux2:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/lib-old:/usr/lib/python2.6/lib-dynload:/usr/lib/python2.6/dist-packages:/usr/lib/pymodules/python2.6:/usr/lib/pymodules/python2.6/gtk-2.0:/usr/local/lib/python2.6/dist-packages
* * * * * mit /home/mit/dev/start.pyI found several answers and solutions that seem the same but nothing helped me. What am I missing? | python script does not run from cron |
This is a kind of generic error message from grpc which can have multiple causes.
In my experience, it can be one of the following things:Your server isn't running (either you forgot to callgrpc::ServerBuilder::BuildAndStartor you didn't start your server application all along).When running the server for the first time Windows Firewall should ask you if you want to allow your application to access the network (I don't recall the actual wording). You want to accept this, of course.You have a wrong address specified in your client application (i.e. a different one than you have set in your server application viagrpc::ServerBuilder::AddListeningPort)Not knowing your actual server and client code these are just assumptions I can make based on my experience with grpc.ShareFollowansweredMay 18, 2020 at 8:39FMeinickeFMeinicke64966 silver badges1515 bronze badgesAdd a comment| | I am trying to implement gRPC server/ client for the first time using Windows Subsystem for Linux kernel and CLion as the IDE (on Windows). My code does not have any other bugs/ issues except this communication failure.The following lines of codeif(status.ok()) {
cv::imshow("Rotated image", decrypt_img);
} else {
std::cout << status.error_code() << " : " << status.error_message() << std::endl;
}yields the following message14 : failed to connect to all addresses | gRPC C++ Error code 14 : failed to connect to all addresses |
keytool:generateKeyPaircould be used to create a keystore that is valid for Tomcat to run an SSL connector. | there is a maven-keytool plugin that could be used to generate ssl certificate during the build, but it requires java 7 to generate it:http://mojo.codehaus.org/keytool/keytool-maven-plugin/generateCertificate-mojo.htmlAre there any alternatives that could be used with java 6?
Thanks! | Generate self-signed ssl certificate as a part of maven build |
IMHO you shouldn't unless youreallyneed the new functionality. Because by merging e.g.masterback intofunctionality1you make it dependend upon the other feature branch. A good read is thegitworkflows(7)man-page.ShareFolloweditedJan 28, 2013 at 13:14CharlesB88k2828 gold badges197197 silver badges222222 bronze badgesansweredJan 28, 2013 at 13:09Michael WildMichael Wild25.4k33 gold badges4343 silver badges4444 bronze badgesAdd a comment| | This is the first time I am using Git Hub. So please co-operate with me.I am working on an iOS project with another developer. Now since we are working on 2 different functionalities, I thought making separate branches for each developer is good way. So my plan in to follow below stepsCreate a local branches namedfunctionality1from the current one usinggit checkout -b functionality1Commit my code infunctionality1branchPush that branch to the remote usinggit push origin functionality1This will add my branch to remote server. I need branches on remote because I can work from anywhere.I will merge it in Master branch usinggit checkout master
git merge functionality1Nowfunctionality1is merged intomasterbranch (provided no conflicts occurred)Other developer will follow same steps.We don't want to delete the branches yet.Now once both branches are merged intomaster, how can each developer will get the merged code frommasterbranch into their respective branches (functionality1&functionality2) & then continue on working on same branch (functionality1&functionality2)? | Steps for Git branching & merging for 2 developers |
Note that by default, spark slave tries to use all the resources of the node it is in - so your question is mainly about how to reduce the priority of other processes in your nodes.
An automatic solution is to use the nice Linux command - but it might be too simplified depends on your cluster configuration (give spark higher priority than other resources on you machine).
Another approach is to implement your custom behavior, and it all depends on how you deploy spark, which cluster manager you use and the nature of the other services in your cluster.
For example - one simple way to accomplish this if you use docker swarm as your cluster manager together with spark stand alone:
have the spark slaves up and running (they don't use many resources when they are idle) together with more services on the same nodes.
When a job will arrive to spark - you can scale all other services on the spark slaves nodes down. This will work fine if your other services can be brought down and up...
If you use Mesos as your cluster manager - you can use the same trick, and you can also implement your own mesos scheduler or allocator
BTW - one other trivial solution is to just allocate unique resources to spark. I guess you already thought about it, but I urge you to give it another thought :-). This way you'll be able to predict the SLA to all the other services in the cluster as well.
Hope this helps.
|
We have a small cluster running Spark to execute jobs from a public-facing web application. The goal of using Spark here is to have an efficient latency for the web app, so when a job is submitted, it needs a response from the cluster as soon as possible.
However much of the time it is idle. So when it's needed, Spark needs to be fast, but when it's not needed, we'd like to use these computing resources otherwise.
For example we have some simulations to run that use OpenMP for local threading and OpenMPI to distribute processing across the cluster. These take some time to run, and we'd like to use the cluster only when it is not needed by Spark.
Is it possible to configure Spark to have very high priority and knock-out or starve other programs? From Spark's configuration I see several options regarding limiting memory and cores used, but not much related to giving Spark higher priority.
We are thinking about using Torque to control the job queue for the OpenMPI simulations. We're thinking about running them inside Docker containers so as to make it easy to update them, as they are in development. The idea is to issue a Torque command that will basically pull a Docker image, start it up on each machine, and trigger the OpenMPI application. Is this too convoluted? Any other recommendations? Can we drop Torque and directly use Spark to also control the OpenMPI jobs? Can one Spark job interrupt another if it has higher priority?
Everything is running on Fedora at the moment.
tl;dr
The larger question here is, how can we launch long-running compute-intensive distributed jobs on a cluster while still ensuring good latency from a Spark instance that coexists on the same hardware?
** This post may betray my relative unfamiliarity with Spark..
| How to configure priorities for Spark and OpenMPI to coexist on a cluster? |
You need to follow these steps to clone your WordPress website from production to staging server -1. First export database of production server WordPress website and open SQL file in an text editor.
2. Then find your domain name(domain.com) and replace it at all places with your domain name/test like domain.com/test.
3. Import production SQL file to test database from phpmyadmin.
4. Open staging WordPress admin like domain.com/test/wp-admin and go to Settings > Permalink section. Just click on the Save button to update htaccess file.
5. Optionally you can go to setting at admin page and save all general settings, menus and check Widgets area too.
6. Now you can access your domain.com/test WordPress website. | I am trying to make a clone of a Wordpress site into a subdirectory. So, I will have two installations, one in the root of the domain, and one in /test. My problem is that, even though I have changed the values for siteurl and home uri in database, my links will redirect to root. So, a page like domain.com/test/contact will redirect to domain.com/contact, which is not what I want. | Wordpress clone in subdirectory |
Alright, failed to get the currentNAMESPACEinside a pod, but I find another way to reach the point -- retrieve the whole host domain fromsearch domianinresolv.conf.Here's the detail:keep the Dockerfile unmodifiedadd acommanditem to deployment.yamlimage: squid:3.5.20
command: ["/bin/sh","-c"]
args: [ "echo append_domain .$(awk -v s=search '{if($1 == s)print $2}' /etc/resolv.conf) >> /etc/squid/squid.conf; /usr/sbin/squid -N" ]This will add a line likeappend_domain .default.svc.cluster.localto the end of file/etc/squid/squid.confthen we can access the services from external via the squid proxy just usingservicename now. | I deployed a squid proxy in each namespace cause I want to access the services from external via the squid proxy, thus I need to add the line below to the squid.conf so that I can access services just using service names:append_domain .${namespace}.svc.cluster.localHere is my problem:I can get${namespace}viametadata.namespaceinside a pod, but how can I get the cluster domain ? Is it possible ?I’ve tried this but it retruned an error when creating pod:- name: POD_CLUSERDOMAIN
valueFrom:
fieldRef:
fieldPath: metadata.clusterNameThanks for your help. | kubernetes how to get cluster domain (such as svc.cluster.local) inside pod? |
If you're running MySQL on AWS EC2 as an RDS instance, yourdatabase_urlwill be the RDS instance name (followed by :port of course).Seehttp://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToInstance.htmlfor more info, but this is normally of the formmyinstance.123456789012.us-east-1.rds.amazonaws.com(whereus-east-1is the region in this example but might vary depending on your setup).Alternatively, if you're running your own MySQL installation on an EC2 instance, you'll need to use your instance's public IP address or external DNS hostname. Seehttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html#concepts-public-addressesfor more info on this. If you're doing this, you will have to have permitted ingress to your instance on the MySQL port, using Security Groups. | I would like to import gtfs files into mysql by using a tool from github, runing the follwoing command:gtfsdb-load --database_url <db url> <gtfs file | url>How can I get thedatabase_urlof mysql located in AWS EC2? | How do I get the database url of AWS EC2 MySQL? |
You cannot use a CNAME record at the apex or domain root with standard DNS services. I suggest you try using a hostname for your endpoint and using the CNAME there egapi.example.com.Alternatively, you can move your DNS to Route 53. The Route 53 system does support aliases at the root domain level, using the Alias record type.For more information on Alias records in Route 53 seehttps://docs.aws.amazon.com/Route53/latest/DeveloperGuide/resource-record-sets-choosing-alias-non-alias.html | I'm trying to set up a custom domain (say,myapi.com) for my API Gateway but am running into problems. The domain is currently registered on GoDaddy. So far, I've followedthistutorial and done the following:Obtained a certificate formyapi.comand*.myapi.comfrom the AWS Certificate Manager.Mapped the domainmyapi.com(not*.myapi.comas I don't need it yet) to an API in the API Gateway.Added a CNAME entry for the resulting "target domain name" in GoDaddy.Here are the screenshots:Now here's the problem: When I doping myapi.comI get:No address associated with hostname. I'm not sure what's causing this, so would really appreciate some help. And while we're at it, are there any other steps I need to perform before this works as expected? | Unable to map custom domain to API Gateway (from Godaddy) |
0
I've experienced this problem. I've been using Chromium ever since. Chromium solved all my problems. You can get it in the Software Center.
Share
Follow
answered Apr 2, 2014 at 21:50
Rob van der LeeRob van der Lee
1311 silver badge55 bronze badges
Add a comment
|
|
Since github using webfront for icons, every time I open github website that tab will crash. But other websites are not crash.
I did everything I can, like disable all extensions, clean all cache, even create a new user profile, still not working.
I'm using Ubuntu linux 12.04, last stable google chrome browser, always up to date.
I searched from google and not found any one has the issue like mine.
And I found any website using Font-Awesome my chrome tab will crash if I open that website.
| Chrome crash every time open github on Ubuntu linux |
31
I'm the developer who put this in. Here's why I added this to the system gitconfig, it's pretty useful!
## Because of this change, git fetch knows about PRs
git fetch
## Now, I can merge PRs by number
git merge origin/pr/24
## See changes from PR #53
git diff master...origin/pr/53
## Get the commit log from PR #25
git log origin/pr/25
Unfortunately, this does have the consequence that the origin remote always exists, even when it doesn't.
Workaround
Whenever you see git remote add origin https://..., instead:
git remote set-url origin https://...
Share
Improve this answer
Follow
edited Oct 10, 2013 at 16:18
answered Oct 10, 2013 at 16:07
Ana BettsAna Betts
74.2k1616 gold badges142142 silver badges209209 bronze badges
3
@Paul Does this mean the manual setup outlined in Checking out Pull Requests locally at GitHub Help is no longer necessary with this new feature? (I tried git checkout pr/999 without doing anything to my .git/config and it worked.)
– Daniel Liuzzi
Oct 28, 2013 at 11:14
After reading Chad's answer and its comments, I went to check my ~\AppData\Local\GitHub\PortableGit_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\etc\gitconfig and, sure enough, the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* was there. So, to answer my own question: yes, newer versions of GHfW come with git checkout pr/999 functionality baked in at the system level, so it is no longer necessary to do any manual configuration to checkout pull requests locally.
– Daniel Liuzzi
Oct 29, 2013 at 11:02
I just loved the first line :)
– DollarAkshay
Sep 11, 2014 at 17:30
Add a comment
|
|
I installed Git for Windows, although I am using the shell not the Windows interface.
If I do a git init, and then try and do a
git remote add origin [email protected]:someuser/testme.git
I get the following error
fatal: remote origin already exists.
So I do a
git remote -v
and it returns the following
origin
upstream
So it appears its there but has no URL set, I don't understand why it's there?
If I do a
git remote rm origin
it produces this
error: Could not remove config section 'remote.origin'
It says that it can't remove the remote.origin config section; I checked the .gitconfig under my home directory and I don't see anything.
Anyway I was able to remedy this by using
git remote set-url origin [email protected]:someuser/testme.git
But I am getting confused as I have used Git before and this never happened.
Could this be something to do with Git for Windows?
| Git: says origin already exists on "NEW" (init) repository, using shell but installed Github for Windows |
You have got the versions the other way around?
The change was introduced in 1.7.8:
When populating a new submodule directory with "git submodule
init", the $GIT_DIR metainformation directory for submodules is
created inside $GIT_DIR/modules// directory of the
superproject and referenced via the gitfile mechanism. This is to
make it possible to switch between commits in the superproject that
has and does not have the submodule in the tree without re-cloning.
https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.8.txt
|
In one version of git, we have (git version 1.7.4.4):
ProjectRoot/.git/modules/SubmoduleX/config
However in another computer we have (git version 1.7.12.4 (Apple Git-37)):
ProjectRoot/SubmoduleX/.git/config
Why the discrepancy? When was this change done?
| .git folder for Submodules |
You should use prometheus to gather metrics from individual backends and then use aggregation in query or pre-aggregate data (using prometheus recording rules).
Prometheus has a number of service discovery mechanism built-in and they can be used to automatically find and use all endpoints your app runs on.For a taste of how configuration can look like you can see for examplehttps://github.com/prometheus/prometheus/blob/release-2.15/config/testdata/conf.good.yml#L199Depending on which cloud service you use you'll be using different _sd_config directives. All available ones are described in the documentation -https://prometheus.io/docs/prometheus/latest/configuration/configuration/ | Initially we had single node application and we used Prometheus where we set metrics path url to our single node application like this:- job_name: 'spring-actuator'
metrics_path: '/prometheus'
scrape_interval: 5sFor now we switched to the cloud application and if we set load balancer path - it will use different node each time so we will see some kind of mess. Is there way to aggregate metrics from the cluster using prometheus? | How to monitor cluster using Promeheus? |
You are correct -- theAuto Scaling Termination Policydetermines which instance(s) will be terminated when an Auto Scaling groupscales-in(removes an instance).Therefore, the best way to refresh your total fleet is:Scale-outbyincreasingtheMinimumsize of the Auto Scaling groupWait for everything to launch and stabilizeScale-inbyreducingthe Minimum sizeDepending upon your scale-in policies, this will cause your Auto Scaling group to reduce the number of instances in the group. The instances with theoldest launch configurationwill be terminated first. (Alternatively, you could useOldestInstance, which would have a similar effect.)If your scaling policies do not cause the instances to terminate, you could force theDesired Capacityto a lower number, thereby triggering the scale-in. | I'm trying to automate the deploy to instances in an auto scaling group.Unfortunately I can't consider CodeDeploy or other AWS services, so I'm trying to do this only with EC2 tools.This is my approach:
i wrote a script that creates an AMI from a "master" instance (the only one I'm deploying to), then creates a new launch config with it, then updates my auto scaling group with it.I'm trying to take advantage of the termination policies, more specifically the "oldest launch configuration" one.
It works like a charm but, as you maybe already know, this only works whenscaling in.How can I update my instances when I'm not scaling in? Any suggestion on how to force the termination of the "old" instances?Thanks for help! | Auto renew EC2 instances in an Auto Scaling Group when a new launch config is found |
Don't you see the difference of case in the 'toolbox' (vs. 'Toolbox') folder name? Windows is case insensitive but git is not.So I would guess that the folders where tracked with different cases.Try this (or from lower to Upper if it's what you need) on a case-sensitive system:git mv Toolbox/* toolbox
git commit --message "Fix folder case"
git pushElse, on a clean working directory:Rename the 'Toolbox' into 'toolbox' with the file explorerRungit add ., you should see files as renamed.Commit and pushAlso, take a look at theignorecaseconfig. | This is an android studio project, and a while back i had some package naming issues when i created a new Library module. Somehow github split my library source code paths, yet my local repo shows everything as it should be:As you can see in the screenshot of my local repo, all code related to my Toolbox library is within the toolbox path. in github however, toolbox/src is housed in the root project directory?LOCAL REPO (correct file structure):REMOTE REPO (incorrect file structure)I've tried creating a new remote and pushing to that, but i get the same problem. Note that any new commits i make are placed under the Toolbox directory where they should be, just older files are stuck.Here is a link to the remote if you'd be willing to look at it for me. I think this has something to do with my package clashing issues i had at the time i commited. I was getting a gradle error saying multiple dex files were found for /BuildConfig. I would highly appreciate any insights or wisdom, and how to prevent this in the future. Thank you stack. If you want any more details on my problem i'll absolutely include them. Thank you!https://github.com/whompum/BonitaToolbox | Why is github separating my library files from their original directory? |
Eclipse SonarQube plugin 3.4 is definitely compatible with Eclipse Mars.Unfortunately, you cannot install it from the Eclipse Marketplace - probably because we need to update the compatibility information there. As mentionned by Freddy in his comment,SONARCLIPS-446was created for this purpose.Meanwhile, please follow the instructions described on"Install SonarQube in Eclipse"to manually install the plugin.UPDATE July 21rst, 2015: the Marketplace has been updated so anybody using Mars can install the plugin through the Marketplace. | I cannot install SonarQube plugins in Eclipse Mars (tested with Java, RCP and Modeling versions).When I search for SonarQube in 'Help' / 'Eclipse Marketplace' then the result list isempty. I can click at the link 'Browse for more solutions' which opens the marketplace site on the internet. There, I see SonarQube with the link 'Install' but when I click on it I get the error "The following solutions (SonarQube) are not compatible with this version of Eclipse"!Any ideas how the problem can be solved? | Is the Eclipse SonarQube plugin compatible with Eclipse Mars? |
set $request_url $request_uri;
if ($request_uri ~ ^/example(.*)$ ) {
set $request_url /module/controller/action;
}
location ~ \.php$ {
fastcgi_pass 127.0.0.1:9090;
#include fastcgi.conf;
fastcgi_param REQUEST_URI $request_url;
#fastcgi_param REQUEST_URI $request_uri;
} | We get information from$_SERVER['REQUEST_URI']not from$_GETor$_POST.I want to define$request_urito change/exampleto/module/controller/action. Please note that I do not want to trigger a redirect.I tried the code below to do this, but it doesn't work.location /example {
rewrite /module/controller/action;
} | How to change $request_uri in nginx? |
Here's a goodwrite-upthat may be related to your problems, also checkthisone out by Weaveworks.Basically there have been a number of issues during the last year created at the GitHubKubernetes issue trackerthat has to do with various DNS latencies/problems from within a cluster.Worth mentioning, although not a fix to every DNS related problem, is that CoreDNS are generally available since version1.11and are or will be default thus replacingkube-dnsas the default DNS add-on for clusters.Here's a couple of issues that might be related to the problem you're experiencing:#47142#45976#56903Hopefully this may help you moving forward. | I have a kubernetes cluster setup on AWS. When i make call to elasticsearch-client.default.svc.cluster.local from a pod, i get unknown host exception occasionaly. It must have something to do with the name resolution, coz hitting the service IP directly works fine.Note : I already have kube-dns autoscaler enabled. I manually tried with almost 6 kube-dns pods. SO i dont think it is because of dns pod scaling.When I set the kube-dns configMap with the upstreamserver values to google nameservers (8.8.8.8 and 8.8.4.4) I am not getting the issue. I assume it is because of api ratelimiting done by AWS on route53. But I dont know why the name resolution request would got to AWS NS. | Occasional Unknownhost Exception from for a service within kubernetes |
Usually, when you want more granularity than 1 minute, you have to write a daemon.I advise you to try, now it's not so hard as it was some years ago. Just start with a simple loop inside a CLI command:while (true) {
doPeriodicStuff();
sleep(1);
}One important thing: run the daemon viasupervisord. You can take a look at articles about Laravel's queue listener setup, it uses the same approach (a daemon + supervisord). A config section can look like this:[program:your_daemon]
command=php artisan your:command --env=your_environment
directory=/path/to/laravel
stdout_logfile=/path/to/laravel/app/storage/logs/your_command.log
redirect_stderr=true
autostart=true
autorestart=true | I have a project that needs to send notifications via WebSockets continuously. It should connect to a device that returns the overall status in string format. The system processes it and then sends notifications based on various conditions.Since the scheduler can repeat a task as early as a minute, I need to find a way to execute the function every second.Here is myapp/Console/Kernel.php:<?php
...
class Kernel extends ConsoleKernel
{
...
protected function schedule(Schedule $schedule)
{
$schedule->call(function(){
// connect to the device and process its response
})->everyMinute();
}
}PS: If you have a better idea to handle the situation, please share your thoughts. | Laravel schedular: execute a command every second |
I also faced the same issue. To get this to "work" I had to sadly remove the phone number requirement which also meant I had to make a new user pool. | According toScopes for Google SignIn, there is no 'phone' scope, the only scopes are openid, email, profile.My Cognito User Pool has a phone user attribute, and it is required.For users who sign-up directly with the user pool, they enter their phone number in Amazon's hosted UI which displays a phone field in the sign up form, all good.For users who sign-up with Google, they get an error. I've traced it to the fact that Google doesn't send over a phone_number and the mapping from Google to User Pools attribute fails. If I create a new pool, which does not require a phone_number federation to Google works, the moment I require that attribute it fails, despite the fact that the Google Account I test with has a phone_number.Is mapping phone really not possible when sign in with Google federated to Cognito User Pool?Is it possible for the the hosted SignUp UI to show a field for my Google users asking them to fill in the phone number between them authenticating with Google and the hosted UI redirecting to my redirect URL?Alternate solutions? | How to map phone number with Cognito User Pool Federated to Google |
You can usesys.exit(is_word_found). But remember you use sys module (import sys).Like this:import sys
word = "test"
def check():
with open("tex.txt", "r") as file:
for line_number, line in enumerate(file, start=1):
if word in line:
return 0
return 1
is_word_found = check()
sys.exit(is_word_found)However, you have a lot of other options too. check out this:https://www.geeksforgeeks.org/python-exit-commands-quit-exit-sys-exit-and-os-_exit/ | I have a python file that opens and checks for a word. The program returns 0 if pass and 1 if fails.import sys
word = "test"
def check():
with open("tex.txt", "r") as file:
for line_number, line in enumerate(file, start=1):
if word in line:
return 0
return 1
is_word_found = check() # store the return value of check() in variable `is_word_found`
print(is_word_found)output
1I have gitlab-ci.yml that runs this python script in a pipeline.image: davidlor/python-git-app:latest
stages:
- Test
Test_stage:
tags:
- docker
stage: Test
script:
- echo "test stage started"
- python verify.pyWhen this pipeline runs the python code prints 1 that means the program failed to find the test word. But the pipeline passes successfully.I want to fail the pipeline if the python prints 1. Can somebody help me here? | How to fail a gitlab CI pipeline if the python script throws error code 1? |
Eduardo Molteni had a great answer:SQL Server Automated BackupsUsing Windows Scheduled Tasks:In the batch file"C:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE" -S
(local)\SQLExpress -i D:\dbbackups\SQLExpressBackups.sqlIn SQLExpressBackups.sqlBACKUP DATABASE MyDataBase1 TO DISK = N'D:\DBbackups\MyDataBase1.bak'
WITH NOFORMAT, INIT, NAME = N'MyDataBase1 Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
BACKUP DATABASE MyDataBase2 TO DISK = N'D:\DBbackups\MyDataBase2.bak'
WITH NOFORMAT, INIT, NAME = N'MyDataBase2 Backup', SKIP, NOREWIND, NOUNLOAD, STATS = 10
GO | This question already has answers here:SQL Server Automated Backups [closed](3 answers)Closed6 years ago.I'm running a small web application with SQL server express (2005) as backend. I can create a backup with a SQL script, however, I'd like to schedule this on a daily basis. As extra option (should-have) I'd like to keep only the last X backups (for space-saving reasons obviously) Any pointers?[edit] SQL server agent is unavailable in SQL server express... | How can I schedule a daily backup with SQL Server Express? [duplicate] |
My first question should be, why are you setting it at all? The server JVM sets the maximum to 1/4 of the main memory size and this is reasonable for most applications. You could change this by building you own JVM or you could create an alias like
alias java="java -Xmx30g"
What you can do is check the memory usage periodically and kill the process if you use more. This is a very bad idea of course.
Instead what you can do is run the program again with the same arguments but with the maximum heap size you want. I.e. you can Runtime.exec.
You cant change it as it reserves the maximum memory size on start up.
BTW There is a common misconception that the heap is the only memory which matters. This is not true as the JVM, the threads stacks, native memory etc all use some memory so you cans et the heap to be 100 MB but the JVM could be using 300 MB.
|
We can use JVM arguments to limit the memory allocated for JVM heap etc.
I would like to know whether we can hard coded these values inside the java program during the development time, instead of adding JVM arguments in the command line when we run the program. Is it possible?
| Can we limit the memory of java application from inside the java application? |
When you choose theNodePortservice type, besides having a Cluster IP, kubernetes will expose the service on a port on each node of the cluster (the same port on each node). So choosing NodePort gets you both: the ClusterIP and the port on each node.
As saidin the docsNote that this Service will be visible as both :spec.ports[].nodePort and spec.clusterIP:spec.ports[].port. | I have 2 pods running on minikube. Pod A has toexpose 2 ports8081 and 9092 to both Pod Binside the k8 clusterand alsooutside k8 clusterso that pod B can reach them and also outside the cluster my consumer can reach them.So my question isshouldI have2 servicescreated for each port?
One to expose as cluster ip and one for node port? Or is there a way to have a single service created to expose this as both cluster IP and NodePort?Also if I have to expose my node port as a particular port, would specifyingnodePortmess up with the cluster ip? | Can I have a single service created to expose as both cluster IP and NodePort? |
Restarting docker worked for me. | I run commanddocker system pruneyesterday, it took some time and then my SSH session was disconnected from different reason.Unfortunately I am getting now:Error response from daemon: a prune operation is already running.Obviously there is a lock and prune command is not running anymore.Does anybody know how remove the lock without stopping and removing all containers?EDIT: Created an issue in repo:https://github.com/moby/moby/issues/36447 | Docker prune stuck in "a prune operation is already running" |
To run the app locally, specify both.yamlfiles todev_appserver.py:dev_appserver.py -A your-app-id application.yaml worker.yaml | I am having trouble loading my GAE module.My cron.yaml:cron:
- description: call frontend instance to call module
url: /callLoadAndProcess
schedule: every day 01:00
timezone: America/New_YorkThen the relevant part of my app.yaml:- url: /callLoadAndProcess
script: callLoadAndProcess.application
secure: always
login: adminNow my callLoadAndProcess.py:import sys
import webapp2
import os
import urllib2
import logging
from google.appengine.api import modules
class callLoadAndProcess(webapp2.RequestHandler):
def get(self):
modules.start_module("loadandprocess","1")
application = webapp2.WSGIApplication([('/callLoadAndProcess', callLoadAndProcess)],debug=True)For my module, I have a loadandprocess.yaml, which is:application: [application name]
module: loadandprocess
version: 1
runtime: python27
instance_class: B4_1G
basic_scaling:
max_instances: 1
handlers:
- url: /.*
script: loadAndProcess.application
login: adminAnd finally, loadAndProcess.py is the script I want run as a backend module:class loadAndProcess(webapp2.RequestHandler):
def get(self):
#DO STUFF
application = webapp2.WSGIApplication([('/loadAndProcess', loadAndProcess)],debug=True)In my development server, when I try to run the cron job via the admin page, I get the following error:line 138, in _CheckAsyncResult
raise mapped_error()
InvalidVersionErrorI feel I set it up correctly... and the version numbers match.. did I miss something? Thanks! | How to load a basic module from a cron job |
Please go through this long tutorial on memory management. It may require some time to read whole, but it explains the basic things nicely.
EDIT : About copy -
When you are using retain then you are just increasing the retain count of the object. But when you use copy, a separate copy (shallow copy) of the object is created. Separate means it is a different object with retain count 1.
For example,
NSObject *obj1 = [[NSObject alloc] init]; // obj1 has retain count 1
// obj1 and obj2 both refer same object. now retain count = 2
// any change via obj1 will be seen by obj2 and vice versa, as they point same object
NSObject *obj2 = [obj1 retain];
// obj3 is a separate copy of the object. its retain count is 1 just like newly allocated object
// change via obj3 will not affect obj1 or obj2 and vice versa as they are separate objects
NSObject *obj3 = [obj1 copy];
|
This might seem a simple question, but I don't really get the idea of when should I use alloc, retain or copy.
| What is the difference between alloc, retain and copy |
It's easy in Kubernetes too. You can do it as follow,Put yourinit.sqlfile into aKubernetes volume.Mount this volume into/docker-entrypoint-initdb.ddirectory of your mysql pod.Here, is an sample yaml file:mysql-init-demo.yamlYou can also use aninit-containerto downloadinit.sqlfile into a Kubernetes volume that is mounted on/docker-entrypoint-initdb.ddirectory of mysql container.UPD:As you have specified in update that the solution you have referred won't work for you. I thinkinit-containerapproach will be best suited for you. Here, is how you can do:Create a pvc. Let it's name isinit-script.Now, add ainit-containerto your mysql pod. Mount thisinit-scriptpvc at some directory of thisinit-container. Configure yourinit-containersuch that it download yourinit.sqlfile on this directory.Mount theinit-scriptin mysql container at/docker-entrypoint-initdb.dLet me know if you need any sample withinit-containerapproach.UPD-2:I have added a sample forinit-containerapproach. You can find ithere. | I have a pod in my AWS EKS Cluster that runs MySQL:5.7. I have an SQL file that initializes and populates the data for it. in a normal docker-compose, I will use a mount point for it in my docker-compose file:volumes:
- ./<path-to-my-config-directory>:/etc/mysql/conf.d
- ./<path-to-my-persistence-directory>:/var/lib/mysql
- ./<path-to-my-init.sql>:/docker-entrypoint-initdb.d/init.sqlIn EKS, I can create a storage class in which to save MySQL data.How can I use my init.sql file (about 8GB) to initialize the MySQL pods running in the EKS cluster?Update:there is another question that explains how to do this if you have a small init file or have access to the Kubernetes host:How to initialize mysql container when created on Kubernetes?In my case though, I am on AWS EKS and my init file is a few gigabytes, so any help would be greatly appreciated. | Initializing a MySQL database deployed in an AWS EKS |
You can use aGenymotionemulator as an alternative of an Android Studio emulator. The Genymotion emulator works correctly even through the VPN. | I have searched everywhere for this question and couldn't find it anywhere.So I'm working on an app for a project and the authentication only works within the university's internet.I configured a VPN on my pc and everything works fine but the actual android device emulator doesn't connect to my VPN (although I have connectivity to internet).I have tried to change proxy settings within android studio but nothing works.Hope you can help me.
Thanks in advance! | How to use my PC's VPN on Android Studio emulator? |
0
below code is causing high memory usage :
array_push($resultfile,$row);
oci_fetch_array is unbuffered meaning it will fetch rows one by one until no rows exists. I would suggest not to push row into another array. instead write your logic inside while loop itself.
Share
Improve this answer
Follow
answered May 2, 2019 at 5:05
Chetan ShenaiChetan Shenai
3111 silver badge44 bronze badges
Add a comment
|
|
Im am running a query and retrieving with OCI_FETCH_ARRAY and I am getting a fatal error, out of memory after I hit a certain volume of records. The result array is 100k rows and about 60 columns.
I have my memory_limit in php.ini set to 2 gigs.
memory_limit = 2056M
It seems to happen when I have more than one person running the script at the same time (or same person running twice as it is set up to run in the background).
It only takes 2 concurrent jobs of 100k records to cause the error.
Everything I've found on OCI_FETCH_ARRAY states that it isn't caching the whole result set in to memory but it looks like it IS.
This is my code (Very straight forward)
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
array_push($resultfile,$row);
$tablerow=$tablerow +1;
unset($row);
}
The error happens on the OCI_FETCH_ARRAY statement after it hits a certain number of loops.
The output file is only 94m (avg) so doesn't seem like I should be anywhere memory limit.
| PHP oci_fetch_array causing out of memory error |
So this did seem to be the solution (in my note above).If using my example from above, you want this to look like:stream {
server {
listen 11016 udp;
proxy_pass juniper_close_stream_backend;
proxy_responses 0;
}
}This tells nginx not to expect a response, which it shouldn't need from UDP. I don't know why theirexamplesdon't show this when discussing DNS, which can be entirely UDP driven. | I have a main syslog server that is receiving syslog from several sources, and I want to send those logs to a Graylog cluster. To help the cluster keep up (on some slow VMs), I need to be able to load balance the messages to Graylog, as sometimes they come in massive chunks from the endpoints (some send 5k logs in bursts every 10 seconds).I'm trying to use nginx as a load balancer for the syslog messages, but I can't seem to get it to work, and it seems to be because nginx is looking for responses from the Graylog servers. With UDP, it's not going to get a response. At least this is what I think is happening.The error I'm getting is this:2016/12/01 11:27:59 [error] 2816#2816: *210325 no live upstreams while connecting
to upstream, udp client: 10.0.1.1, server: 0.0.0.0:11016,
upstream: "juniper_close_stream_backend", bytes from/to client:932/0,
bytes from/to upstream:0/0As an example of this rule in my nginx.conf, it looks like:stream {
server {
listen 11016 udp;
proxy_pass juniper_close_stream_backend;
}
upstream juniper_close_stream_backend {
server 10.0.1.2:11016;
server 10.0.1.3:11016;
server 10.0.1.4:11016;
}
}In this instance, my syslog box is 10.0.1.1, and my downstream Graylog boxes are 10.0.1.[2-4]. I see this error message for all of them.Any clue on what is happening? When I run tcpdump on the Graylog boxes, I'm seeing the traffic coming from the load balancer, which means it's working. But I think nginx is expecting a response and is giving me an error. | UDP forwarding with nginx |
Look at the Upsource from jetbrainshttps://www.jetbrains.com/upsource/ | On doing some research wrt to code review tools, I found the working ofGerritwithGIT. Developers push their changes which then resides on Gerrit repository for review. Once review is approved, the changes are finally pushed to git repo.I am usingsvnin my project withsonarQubeas the code review tool. But, usually we run the sonarqube when required. Point here is there is no automation of code review. Thus, we don't allow all developers with commit access. They send the patches to the concerned lead, who is reviewing and then committing.I am looking for ways to automate this whole process and make it more efficient. | Creating a code review automated workflow |
Close. You would have to use delete[] because you allocated each of them with new[]:
delete[] ppint[0];
delete[] ppint[1];
delete[] ppint[2];
delete[] ppint[3];
But of course, you should use a loop:
for(int i = 0; i < 4; i++ ) {
delete[] ppint[i];
}
And then don't forget to delete[] ppint itself:
delete[] ppint;
However, in C++, we prefer to not mess around with dynamically allocated arrays. Use a std::vector<std::vector<int>> or a std::array<std::array<int, 4>, 4>. If you care about locality of data, try boost::multi_array.
|
So, I have this code, and I am trying to deallocate the array ppint at the end. I have tried using leaks with Xcode to figure out if it is working, but I don't quite understand it. Will doing this work?
delete ppint[0];
delete ppint[1];
delete ppint[2];
delete ppint[3];
Or is there something else that must be done?
#include <iostream>
#include <string>
#include <unistd.h>
using namespace std;
int main()
{
int **ppint;
ppint = new int * [4];
for(int i = 0; i < 4; i++ ) {
ppint [i] = new int[4];
} // declares second layer of arrays
for(int i = 0, count = 0; i < 4; i++ ) {
for(int j = 0; j < 4; j++ ) {
count++;
ppint [i] [j] = count;
} //init part 2
} // init array
for(int i = 0; i < 4; i++ ) {
for(int j = 0; j < 4; j++ ) {
cout << ppint [i] [j] << endl;
} // print part 2
} //print array
}
| De-allcoating dynamically allocated multidimensional arrays. |
7
You really don't want to do this if you can help it - the best thing you can do if you can't get away from linked lists is to emulate them via arrays and use array indices rather than pointers for your links.
Share
Follow
answered Oct 20, 2010 at 7:00
Paul RPaul R
211k3737 gold badges398398 silver badges565565 bronze badges
1
3
The author provides NO evidence or explanation of why not to use LL. You can create LLs with pointers on GPU. These types of structures are need as we do more complex algorithms on GPU's. using array subscripts, for LL's, is only necessary if you need to LL to persist across memory spaces.
– Tim Child
Aug 3, 2013 at 14:10
Add a comment
|
|
Is it possible to create a linked list on a GPU using CUDA?
I am trying to do this and I am encoutering some difficulties.
If I can't allocate dynamic memory in a CUDA kernel, then how can I create a new node and add it to the linked list?
| Creating a linked list using CUDA |
-2Kubernetes (kubectl) does not offer an equivalent command. Ideally you should not be using this command at all outside your local development environment (which is docker)The best practice is to start containers with readonly root filesystem, so that you avoid storing any important state in containers. Kubernetes can kill and restart your pod in another node as a new container, so you should not care about thedocker diffthat happens on the container.ShareFollowansweredJun 4, 2017 at 6:03ahmet alp balkanahmet alp balkan43.9k4040 gold badges144144 silver badges218218 bronze badges2Thank you for the reply. My application just need to monitor all file system changes so there is no problem to restart a pod in another node as a new container. I agree with you, using readonly root filesystem is a good practice, unfortunately most of existing servers writes something to filesystem even if application logic doesn't–Zavolokin RomanJun 4, 2017 at 14:45@ZavolokinRoman Did you find any solution for this?–AshwaniJun 12, 2021 at 13:03Add a comment| | I am using docker diff in my application in order to find all changed files in a container. Now, my application manages containers through Kubernetes and don't have a direct access to them. I found Kubernetes implementations for several docker commands (like kubectl logs), bit docker diff is missed.Is there a way to execute docker diff for a pod through Kubernetes?Many thanks | how to execute docker diff command using kubernetes |
All interactions with the AWS APIs (including via SDK, like boto3) require credentials, you can find more info on how boto3 manages credentials here.
Since you're running this on an EC2 instance, best practices recommend to manage credentials via Instance Profile. Assuming that you have already assigned an IAM Role to the EC2 instance, all you need to do is to specify a region for your code. You can find info on how to assign an IAM Role to your EC2 on the official AWS documentation.
AWS Data Wrangler relies on boto3 and allows to specify a region like so:
boto3.setup_default_session(region_name="us-east-2")
Source: AWS Data Wrangler - Sessions
You can either hardcode the region like in the example above or you can retrieve the region in which the EC2 is deployed using the instance metadata endpoint.
The following endpoint:
curl http://169.254.169.254/latest/dynamic/instance-identity/document
Will return a json that contains, among other info, the region of the EC2:
{
"privateIp" : "172.31.2.15",
"instanceId" : "i-12341ee8",
"billingProducts" : null,
"instanceType" : "t2.small",
"accountId" : "1234567890",
"pendingTime" : "2015-11-03T03:09:54Z",
"imageId" : "ami-383c1956",
"kernelId" : null,
"ramdiskId" : null,
"architecture" : "x86_64",
"region" : "ap-northeast-1", # <- region
"version" : "2010-08-31",
"availabilityZone" : "ap-northeast-1c",
"devpayProductCodes" : null
}
You can easily implement this request in Python or by other means if needed.
|
I am using python3
I am trying to read data from aws athena using awswrangler package.
Below is the code
import boto3
import awswrangler as wr
import pandas as pd
df_dynamic=wr.athena.read_sql_query("select * from test",database="tst")
Error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.6/site-packages/awswrangler/_config.py", line 361, in wrapper
File "/usr/local/lib/python3.6/site-packages/botocore/regions.py", line 148, in _
endpoint_for_partition
raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.
I am not sure to specify and where in order for sql query to work
| aws read data from athena error using aws wrangler |
It would be best to:install Git on Godaddy (as in thisblog post)setup a bare repo on the upstream side (ie, the GoDady side, the one where you would push your code)add a post-receive hook on that upstream repo in order for a non-bare repo to update itself: see links in the "Is--bareoption equal tocore.bareconfig in Git?" answer. | I develop front-end and back-end of many websites hosted on godaddy. I was looking for a way to synchronize the godaddy file manager with my local repository so as to prevent me from uploading the edited files each time. I push my code to github directly, but is there a way to push the code directly to godaddy account without using its file manager?Also sometimes, with other systems, I edit the code directly on the server if I get some problems with the code, which becomes then difficult to get it on my local system.It would be of great help to directly push it without using the file manager each time. | Synchronize github with godaddy account |
Although Node.js runs the main application code in a single thread, the Node.js runtime is multi-threaded. Node.js has an internalworker poolthat is used to run background tasks, including I/O and certain CPU-intensive processing like crypto functions. In addition, if you use theworker_threadsfacility (not to be confused with the worker pool), then you would be directly accessing additional threads in Node.js. | We are running a single NodeJS instance in a Pod with a request of 1 CPU, and no limit. Upon load testing, we observed the following:NAME CPU(cores) MEMORY(bytes)
backend-deployment-5d6d4c978-5qvsh 3346m 103Mi
backend-deployment-5d6d4c978-94d2z 3206m 99MiIf NodeJS is only running a single thread, how could it be consuming more than 1000m CPU, when running directly on a Node it would only utilize a single core? Is kubernetes somehow letting it borrow time across cores? | Kubernetes NodeJS consuming more than 1 CPU? |
So just as a reference.Istio configures prometheus with a 'kubernetes-pods' job. At least while using the 'demo' profile. In this prometheus job config, there is arelabel_configs:
...
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)Which gets the pod labels.EnablingmeshConfig.enablePrometheusMerge=trueon the istio operator or whathever installation you are using will append the labels to the istio metrics. | I am using istio 1.6.3I would like to add a simple dimension to the metrics exported by istio to prometheus.
More specifically, if my Pod has a labelbranch=master, I'd like to add abranchdimension with themastervalue to theistio_requests_totalmetric.(I tried adding this label on the service level, without avail)My goal is to then be able to query the metrics on prometheus, withsum(rate(istio_requests_total[5m])) by (branch)I read this piece of documentation:https://istio.io/latest/docs/tasks/observability/metrics/customize-metrics/But it seems like getting thedestination.labels["branch"], or getting any label at all is not supported (apart from theapporversionlabels, which are builtindestination_appanddestination_version).Help! | Istio - How to add custom label-based metrics? |
Found the problem, when I created the API token I selected "Viewer" permissions, I was thinking its enough to just make a get request on alerts, but apparently it is not, made a new API token with "Admin" permissions and it works. | I am trying to use the grafana api (doc herehttp://docs.grafana.org/http_api/alerting/) to get the list of all the alerts in grafana.
Here's what I tried:uri = URI("http://example:3000")
headers = {
'Authorization'=>'Bearer test',
'Content-Type' =>'application/json',
'Accept'=>'application/json'
}
http = Net::HTTP.new(uri.host, uri.port)
request1 = Net::HTTP::Get.new("/api/dashboards/uid/uKH1CKVmk")
response1 = JSON.parse(http.request(request1).body)This one works, it returns the json of the dashboard, but when I try :request2 = Net::HTTP::Get.new("/api/alerts?state=ALL") or
request2 = Net::HTTP::Get.new("/api/alerts?dashboardId="+response1["id"].to_s+"")
request2['Authorization'] = "Bearer test"
request2['Content-Type'] = "application/json"
request2['Accept'] = "application/json"I get an empty json.Any ideas what I am doing wrong ?Thanks,
Nicu | How to get grafana alerts in ruby |
I'm not test this solution in facebook app but on wild web you can use this<script src="//ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>as proof :)http://paulirish.com/2010/the-protocol-relative-url/With this all resources loaded with page protocol, so user don't see confirmation about unsecured elements on page.Just create test app with Heroku and my chromium not angry about https resouces inside frame so problems depends on browser. | In our app (https://apps.facebook.com/testedenivel), we explicitly reference the page css in a https link like this:<link rel="stylesheet" href="https://d2asm4nez8zghw.cloudfront.net/content/app-teste-de-nivel.css?v=0.96.02" type="text/css" media="screen">But strangely, Facebook is preloading this this css file as a HTTP link. At some point before, we used this HTTP url but later we changed it to HTTPS, and now it seems that Facebook is using a former, cached version of that url:<script type="text/javascript">
new Image().src = "http:\/\/www.talkfast.com.br\/content\/app-teste-de-nivel.css";
</script>The problem is that when the user enters our app via secure browsing, the HTTP link preloading is causing the browser to alert our users that some insecure content is about to be loaded. We'd like to know how to tell Facebook to remove this preloading script, or at least to use our current HTTPS url, like this:<script type="text/javascript">
new Image().src = "https://d2asm4nez8zghw.cloudfront.net/content/app-teste-de-nivel.css?v=0.96.02";
</script>There seems to be scarcity of reference regarding this issue on the web, so any help would be appreciated. | Why is Facebook inserting a preload script for my app's css in HTTP when my page's reference is in HTTPS? |
npm config set proxy "your proxy"
npm config set https-proxy "your proxy"To show setupnpm config list | How to configure the corporate proxy url for GIT & NPM package in Windows 10. There is no .gitconfig or .npmrc file created in Users folder. | Proxy configuration for GIT and NPM in Windows10 |
1
Try replacing the backslashes (\) with forward slashes (/):
and try this
cd /c/Users/prakh/OneDrive/Desktop/github/my-github/src/app
Also
The /c/ at the beginning of the path is used in Git Bash to specify the C:\ drive in Windows.
Also, ensure that the directory app exists under C:\Users\prakh\OneDrive\Desktop\github\my-github\src\. If you still get a "No such file or directory" error, the path might be wrong or the directory might not exist.
Share
Improve this answer
Follow
edited Nov 16, 2023 at 7:57
answered Nov 15, 2023 at 4:20
raj03raj03
50311 gold badge77 silver badges2121 bronze badges
0
Add a comment
|
|
error coming by cd filename
prakh@Prakhar11 MINGW64 ~ (main)
$ cd C:\Users\prakh\OneDrive\Desktop\github\my-github\src\app
bash: cd: C:UsersprakhOneDriveDesktopgithubmy-githubsrcapp: No such file or directory
trying to add file in github and push it
| No such file or directory found - git bash |
Youcan't get valid SSLcertificate fortest-lb-123456.ap-southeast-1.elb.amazonaws.com. This is because this domain belongs to AWS. To get HTTPS on your ALB, you needyour own domain. You can buy it from Route53 or any external domain registrar.Once you have yourowndomain, you can get a free SSL certificate for it using AWS ACM. | I am currently trying tosetup httpsfor my backend program (Spring Boot). My first step was to deploy my Backend program using AWS Fargate which gives a public IP inhttp.Then I setted up an AWS Application Load Balancer for the AWS Fargateusing http only.
This process was successful and I am able to call my BE program through the LB with a domain that looks like this: (The numbers and lb name in here are not the real thing)test-lb-123456.ap-southeast-1.elb.amazonaws.comThen I want to add an https listener to the LB, so I clicked on "Add Listener" and "Requests a new ACM Certificate" just like the picture belowThen when prompted to ask for a domain name, I add the exact domain that I mentioned above.But this request always fails with errorAdditional verification required to request certificates for one or more domain names in this requestMy question is, am I doing this correctly? Should I not add the "test-lb..." domain above when prompted to ask for a new certificate? If not, then what domain should I use ?Thank YouEDIT:Apparently the images might not be displayed correctly yet because I am a low-reputation user, hopefully the images will be shown after review.reference | Trouble when adding https listener to AWS Application Load Balancer |
-1After merging the repo the last merge-commit can be removed by simply restoring the Repo's state to the last commit from the parent repo.Use command:git log --format="%H" -n 1---> To get the last commit id from the parent repogit reset --hard fb62ef635b07afaf719ba15841579ed12e1224b0bring back the state of Repo to previous statefb62ef635b07afaf719ba15841579ed12e1224b0 is the commit id from the previous state | I was able to sync files from oneRepoAtoRepoBusing 'fetch' and 'checkout' to my master and handling the conflicts (if any). but this approach caused me to make a 'merge-commit' on RepoB.Is there any way to do itwithoutthat commit id being generated?
I wanted toscheduleall the commits and then sync then on a regular basis through chron-task.I also looked into git-daemon and post-commit hooks. If this can be done please provide an example.Initial state of Repos:After applying merge:After resetting to last commit (Create File02.txt): | How to sync two different Git repos without making a commit? |
8
Bare repositories don't have working copies so you won't "see" any files. Try doing a git log, you can see the commits. Clone from the bare repo and you'll get files.
Share
Improve this answer
Follow
answered Oct 1, 2013 at 15:15
Noufal IbrahimNoufal Ibrahim
72k1313 gold badges138138 silver badges173173 bronze badges
4
Thanks, I thought bare repos were the ideal repos that will only be PUSHED to so I was going to use this as a staging server (so of course will need to see the files. Should I CLONE the local repo instead even though I don't need full git tree?
– DevKev
Oct 1, 2013 at 15:17
@KevinOrin: You should have your running stage version separate from the bare repository since pushing to a non-bare repository has a number of issues. You can update it with a git pull run from a post-update hook in the bare repository.
– Benjamin Bannier
Oct 1, 2013 at 15:25
Thanks but don't think I will need a Bare repo at all @BenjaminBannier - I am just wondering how to setup the staging since a simple "git init" in the past has led to a tree issue when I tried to push to it.
– DevKev
Oct 1, 2013 at 15:32
1
A bare repository contains only your history. A normal repository contains your history and a copy of whichever branch you have checked out. The reason you should have a bare repository is that a normal one has to be checked out somewhere, and you can not push to a checked out branch (git would not know what to do with any conflicts).
– ChrisA
Oct 1, 2013 at 16:41
Add a comment
|
|
I have my local dev repo (origin) and a remote repo which I created using git init --bare as recommended here. I also ran git --bare update-server-info
git config --bool core.bare true
Git remote -v shows
origin http://staging.websitename.com (fetch)
origin http://staging.websitename.com (push)
remote ssh://[email protected]/home/user/public_html/staging (fetch)
remote ssh://[email protected]/home/user/public_html/staging (push)
After this and running git push remote or git push -all remote, it goes through and gives me no errors. Why don't I see the files on the remote repo??
Compressing objects: 100% (4121/4121), done.
Writing objects: 100% (4242/4242), 18.70 MiB | 694 KiB/s, done.
Total 4242 (delta 495), reused 0 (delta 0)
| Why don't I see files after push to Bare git repo |
Yes, yes and more yes. Here are some good things to google/hunt down on SO and SF--ec2 command line tools,--making your own AMI's from running instances (to save tedious and time consuming startup gumf),--route53 APIs for doing DNS magic,--ubunutu cloud-init for startup scripts,--32bit micro instances are your friend for dev work as they fall in thefree usage bracket | I'm still cheap.I have a software development environment which is a bog-standard Ubuntu 11.04 plus a pile of updates from Canonical. I would like to set it up such that I can use an Amazon EC2 instance for the 2 hours per week when I need to do full system testing on a server "in the wild".Is there a way to set up an Amazon EC2 server image (Ubuntu 11.04) so that whenever I fire it up, it starts, automatically downloads code updates (or conversely accepts git push updates), and then has me ready to fire up an instance of the application server. Is it also possible to tie that server to a URL (e.g ec2.1.mydomain.com) so that I can hit my web app with a browser?Furthermore, is there a way that I can run a command line utility to fire up my instance when I'm ready to test, and then to shut it down when I'm done? Using this model, I would be able to allocate one or more development servers to each developer and only pay for them when they are being used. | Using Amazon AWS as a development server. |
I finally found the configuration forawswrangler:import awswrangler as wr
wr.config.s3_endpoint_url = 'https://custom.endpoint'ShareFollowansweredMar 25, 2021 at 2:27David ParksDavid Parks31.1k4747 gold badges191191 silver badges340340 bronze badgesAdd a comment| | I'm attempting to use the python packageawswranglerto access a non-AWS S3 service.TheAWS Data Wranger docsstate that you need to create aboto3.Session()object.The problem is that theboto3.client()supports setting theendpoint_url, butboto3.Session()does not(docs here).In my previous uses ofboto3I've always used theclientfor this reason.Is there a way to create aboto3.Session()with a customendpoint_urlor otherwise configureawswranglerto accept the custom endpoint? | How to get python package `awswranger` to accept a custom `endpoint_url` |
Thx for the link Chad. But actually, if you read on:
If local_work_size is specified, the
values specified in global_work_size[0], … global_work_size[work_dim - 1] must be evenly
divisible by the corresponding values specified in local_work_size[0], …
local_work_size[work_dim – 1].
So YES, the local work size must be a multiple of the global work size.
I also think the assigning the global work size to the nearest multiple and being careful about bounds should work, I'll post a comment when I get around to trying it.
|
Hello: Does Global Work Size (Dimensions) Need to be Multiple of Work Group Size (Dimensions) in OpenCL?
If so, is there a standard way of handling matrices not a multiple of the work group dimensions? I can think of two possibilities:
Dynamically set the size of the work group dimensions to a factor of the global work dimensions. (this would incur the overhead of finding a factor and possibly set the work group to a non-optimal size.)
Increase the dimensions of the global work to be the nearest multiple of the work group dimensions, keeping all input and output buffers the same but checking bounds in the kernel to avoid segfaulting, i.e. do nothing on the work items out of bound of the desired output. (This seems like the better way.)
Would the second way work? Is there a better way? (Or is it not necessary because work group dimensions need not divide global work dimensions?)
Thanks!
| Does Global Work Size Need to be Multiple of Work Group Size in OpenCL? |
I found the problem. The cert was trying to be invoked within an IIS Express context while running a .NET MVC project within visual studio. Somehow that was causing the cert to mis-identify itself. When I published the project and ran it under true IIS, and set the IIS bindings to look at my new cert, everything worked. | My self-signed localhost cert (aliased tonate-pc-ultimate.com) is being rejected by the browser:You can see that I created the self-signed cert and placed it inCertificates -> Trusted Root Certification Authorities:I created the cert fornate-pc-ultimate.comand notlocalhostbecause I am making API calls against a system that requiresiframeinteractions and it disallowslocalhostas the host.I addednate-pc-ultimate.comto myhostsfile as you can see:When I view the "bad" certificate in Chrome I see this:It appears that Chrome is not fooled by myhostsfile entry nor the cert created fornate-pc-ultimate.com. It seems to blindly seelocalhostand has no awareness ofnate-pc-ultimate.com.I do also have a self-signed certificate made forlocalhost, which I have had for a long time. Could there be a collision going on?What am I doing wrong? How can I solve this? | IIS self-signed aliased localhost cert rejected by browser |
It's not great, but it won't get your app rejected unless it causes a crash in front of a reviewer. The size is less important than how often it occurs. If it only occurs once every time the app is run, that's not a big deal. If it happens every time the user does something, then that's more of a problem.
LLVM's static analyser can find some of these problems for you. Clean your build, then select Build and Analyze from the Build menu. There's also a Leaks template in Instruments.
It's probably a good idea for you to track down these bugs and fix them, because Objective C memory management is quite different compared to Java, and it's good to get some practice in with smaller stuff before you're stuck trying to debug a huge problem with a deadline looming.
|
I am new to Objective-C (coming from Java) and I think I am getting a pretty good understanding of memory management.
But when my app loads, I get a extremely small memory leak, that only occurs when the game is loading (we are talking about 32 to about 512 bytes).
It's random when it leaks, and it doesn't seem like it's the user that triggers the leak.
Normally it is detected after about 20sec to 1min.
The information I get from the debugger is never the same. Sometime it's UIApplication thats "responsible frame", sometimes it's [UIWindow makeKeyAndVisible] and sometimes it's [UNibDecoder].
Is this bellow a "accepted" limit, or should the app not leak at ALL?
This is my first "big" app. I have done a minor flipsideview app, and there where no leaks what so ever..
On the other hand, what is the best way to identify leaks?
| Is any memory leak in iOS accepted at all? |
Use include directive for such factorization:includeCreate file in the nginx config folder like
/etc/nginx/conf.d/location_php.cnf (not .conf to avoid auto-loading by nginx)location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm-client2.sock;
fastcgi_index index.php;
include fastcgi_params;
}and then include it into server blocks:server {
listen 443;
server_name client1.localhost.eu;
ssl on;
ssl_certificate ...;
ssl_certificate_key ...;
root /var/www/client1;
include /etc/nginx/conf.d/location_php.cnf;
# OR use relative path to nginx config root:
# include conf.d/location_php.cnf;
} | I have to configure multi https website with a dedicated certificate for each website. It works fine like that.server {
listen 443;
server_name client1.localhost.eu;
ssl on;
ssl_certificate ...;
ssl_certificate_key ...;
root /var/www/client1;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm-client1.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
server {
listen 443;
server_name client2.localhost.eu;
ssl on;
ssl_certificate ...;
ssl_certificate_key ...;
root /var/www/client2;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm-client2.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}Now, I would like to factorize the "location" block, because it is always the same. Is it possible ?
(I have also tried to have only on server block, but it's not possible to put a variable in the ssl attribute)Thanks a lot for your help.Eric | A same "Location" rule for multi "Server" block |
If you're looking for a way to haveIssuesshow up like WorkItems in your task list in visual studio, I don't think there is a solution for this to date.You can however assign developers to issues within GitHub:Create or Edit an IssueClick thegearnext to "No one is assigned".Select a member from yourorganizationto assign the issue to them. | I have started to use Cloud9 IDE recently and have to say I really like it as an individual. I use VS 2010 at work and TFS 2010 too. This made me think about the TFS equivalent for Cloud9. GitHub is something I have always been aware of but never really used.I have done my research and read docs etc, what I really need some clarification in though is the whole Work Item system. I know GitHub has an Issue tracking but does it have a Work Item system similar to TFS. With the main features such as assigning work items to developers?A little explanation to just clarify would be fantastic. Thanks! | Explaining GitHub to a TFS user |
0
It sounds like you never CREATEd the columnfamilies in the new keyspace.
Share
Improve this answer
Follow
answered Oct 9, 2012 at 17:28
jbellisjbellis
19.4k22 gold badges3838 silver badges4747 bronze badges
Add a comment
|
|
I need to copy data from one KS to another KS. Keyspaces has different names.
I've made a snapshot of one keyspace and do all as said in datastax:
http://www.datastax.com/docs/1.1/operations/backup_restore
After start cassandra see old column families and doesn't see new column families in another KS.
What i am doing wrong?
| Cassandra db doesnt see new column families after backup restore |
According to the error you get, a field calledls.Usage.UserUsageof type float contains the value'NaN'which is not a float.What you could do is to modify your mapping to set theignore_malformedsettingto true so that this value is ignored, but it won't prevent the document from being indexed.The other option is to make sure to not produce such wrong values upstream. | I read my services logs using filebeat ,then filebeat sends the logs to logstash for parsing. logstash sends the parsed logs to elasticsearch to be indexed.
But today this error happens in logstash and no logs is indexed in elasticsearch.[2021-11-02T11:35:36,774][WARN ][logstash.outputs.elasticsearch] Could
not index event to Elasticsearch. {:status=>400, :action=>["index",
{:_id=>nil, :_inde ::Event:0xf85da17>],
:response=>{"index"=>{"_index"=>"logstash-alias-000015",
"_type"=>"_doc", "_id"=>"YNas33wBlcfHwocoMbSU", "status"=>400,
"error"=>{"type" ls.Usage.UserUsage] of type [float] in document with
id 'YNas33wBlcfHwocoMbSU'. Preview of field's value: 'NaN'",
"caused_by"=>{"type"=>"illegal_argument_exc ]"}}}}}I searched but did not find a clue, Any help is much appreciated. | logstash output error in sending logs to elasticsearch |
Many people will browse the history after having locally cloned the repository. All commands like git log and git show display the precise date.
When you're browsing online, just hover the date :
|
I browsed around Github but I cannot find a way to view what hour someone submitted a commit, say 3 months ago.
Is there a way to do this online on the GitHub site?
| Can people see the hours and minutes on my commits on Github? |
I had the same issue and resolved by updating policies for the Role as described here:https://docs.aws.amazon.com/step-functions/latest/dg/cw-logs.htmlNormally PutLogEvents, CreateLogStream should be enough for resources like Lambda but apprantly Step Function need other log policies as well. | I am running into Some permissions issue i am not able to figure out.The step function deployment fails because of error:Error: AccessDeniedException: The state machine IAM Role is not authorized to access the Log Destination
10:12:19 status code: 400, request id: ff46f8c0-fcc8-4190-ba6a-13f5ab617c78
10:12:19
10:12:19 on step_function.tf line 1, in resource "aws_sfn_state_machine" "oss_integration_data_process_sf":
10:12:19 1: resource "aws_sfn_state_machine" "os_int_data_process_sf" {funny thing is, it only happens to one lambda while all lambdas have same prefix and we have step function give permissions as:"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents",
"logs:AssociateKmsKey",
"logs:CreateLogDelivery",
"logs:GetLogDelivery",
"logs:UpdateLogDelivery",
"logs:DeleteLogDelivery",
"logs:ListLogDeliveries",
"logs:PutResourcePolicy",
"logs:DescribeResourcePolicies",
"logs:DescribeLogGroups"
],
"Resource": [
"arn:aws:logs:us-east-1:XXXX:log-group:*/*"
],
"Effect": "Allow"
}```
I can run the lambda after deployment and see CW log stream with lambda name is getting created. | Aws step function deployment log access issue |
You can add label to nodes that you want to run pod on and add nodeSelector to pod configuration. The process is described here:http://kubernetes.io/docs/user-guide/node-selection/So basically you want tokubectl label nodes A node_type=foo
kubectl label nodes B node_type=fooAnd you want to have this nodeSelector in your pod spec:nodeSelector:
node_type: foo | How can I configure a specific pod to run on a multi-node kubernetes cluster so that it would restrict the containers of the POD to a subset of the nodes.E.g. let's say I have A, B, C three nodes running mu kubernetes cluster.How to limit a Pod to run its containers only on A & B, and not on C? | How to specify pod to node affinity in kubernetes |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.