Response
stringlengths
15
2k
Instruction
stringlengths
37
2k
Prompt
stringlengths
14
160
+50It is correct that go-client does not have support for metrics type, but in the metrics package there is a pregeneratedclientthat can be used for fetching metrics objects and assign them right away to the appropriate structure. The only thing you need to do first is to generate a config and pass it to metrics client. So a simple client for metrics would look like this:package main import ( "k8s.io/client-go/tools/clientcmd" metrics "k8s.io/metrics/pkg/client/clientset/versioned" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) func main() { var kubeconfig, master string //empty, assuming inClusterConfig config, err := clientcmd.BuildConfigFromFlags(master, kubeconfig) if err != nil{ panic(err) } mc, err := metrics.NewForConfig(config) if err != nil { panic(err) } mc.MetricsV1beta1().NodeMetricses().Get("your node name", metav1.GetOptions{}) mc.MetricsV1beta1().NodeMetricses().List(metav1.ListOptions{}) mc.MetricsV1beta1().PodMetricses(metav1.NamespaceAll).List(metav1.ListOptions{}) mc.MetricsV1beta1().PodMetricses(metav1.NamespaceAll).Get("your pod name", metav1.GetOptions{}) }Each of the above methods from metric client returns an appropriate structure (you can check thosehere) and an error (if any) which you should process according to your requirements.
The kubernetes go client has tons of methods and I can't find how I can get the current CPU & RAM usage of a specific (or all pods).Can someone tell me what methods I need to call to get the current usage for pods & nodes?My NodeList:nodes, err := clientset.CoreV1().Nodes().List(metav1.ListOptions{})Kubernetes Go Client:https://github.com/kubernetes/client-goMetrics package:https://github.com/kubernetes/kubernetes/tree/master/staging/src/k8s.io/metricsAs far as I got the metrics server implements the Kubernetes metrics package in order to fetch the resource usage from pods and nodes, but I couldn't figure out where & how they do it:https://github.com/kubernetes-incubator/metrics-server
Get current resource usage of a pod in Kubernetes with Go client
27 By forcing curl and apt to use ipv4, download.docker.com is resolved correctly. in curl, add the -4 argument Add Docker’s official GPG key: $ curl -4fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - then to force apt to use ipv4 => https://www.vultr.com/docs/force-apt-get-to-ipv4-or-ipv6-on-ubuntu-or-debian Share Improve this answer Follow edited Jan 23, 2019 at 10:34 Daniele Santi 77133 gold badges2525 silver badges3232 bronze badges answered Jan 23, 2019 at 9:55 Laurent CailleLaurent Caille 27133 silver badges22 bronze badges 1 1 While providing links is useful, it would be MORE helpful to the asker if you posted a summary of the steps involved on the link you posted. Can you please elaborate on the part that says "to force apt to use ipv4"? Links can go dead any time. For more tips, see How to answer. – Daniele Santi Jan 23, 2019 at 10:05 Add a comment  | 
I am getting this error while installing docker CE on my ubuntu machine curl: (6) Could not resolve host: download.docker.com gpg: no valid OpenPGP data found. While performing the step Add Docker’s official GPG key: $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - as mentioned here https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#install-docker-ce-1
"Could not resolve host: download.docker.com" while installing docker CE
1 After giving it a few tries, I could finally solve the question with the help I found in this post. First of all, I cleaned up the cache for the public path: igor@skynet:.../igorcosta$ git rm -r --cached public Then, I forced a new submodule with: igor@skynet:.../igorcosta$ sudo git submodule add --force https://github.com/igordeo-costa/igordeo-costa.github.io.git public Adding existing repo at 'igorcosta/public' to the index At that point, I thought that the problem had already been solved. So, I ran the Hugo's code to create the public directory: igor@skynet:.../igorcosta$ sudo hugo -t "m10c" The command git remote -v showed me the correct path to the submodule: igor@skynet:/home/dados/MeuBLog/meuHugo/igorcosta/public$ git remote -v origin https://github.com/igordeo-costa/igordeo-costa.github.io.git (fetch) origin https://github.com/igordeo-costa/igordeo-costa.github.io.git (push) Finally, I ran the add, commit and push to the submodule main branch and then it worked perfectly! Thank you, guys, for the help! Share Follow answered May 3, 2021 at 15:18 Igor de Oliveira CostaIgor de Oliveira Costa 4355 bronze badges Add a comment  | 
My blog is hosted at github.io and it uses Hugo's "m10c" theme. The blog was working fine until today, when I tried to write two posts. I could post the first one, but, when I tried the second one, I could not push to the submodule in main branch. That was the error message: error: src refspec main does not match any So, I've investigate the public directory with: git remote -v And the result doesn't show the submodule repo (igordeo-costa.github.io), but only the repos where I maintain my static files. That was the command line and the error: igor@skynet:.../public$ git push origin main error: src refspec main does not match any error: failed to push some refs to 'https://github.com/igordeo-costa/meuHugo.git' igor@skynet:.../public$ git remote -v origin https://github.com/igordeo-costa/meuHugo.git (fetch) origin https://github.com/igordeo-costa/meuHugo.git (push) igor@skynet:/home/dados/MeuBLog/meuHugo/igorcosta/public$ I don't know what is happening here. Thanks in advance for any help.
I can't push anymore to a github submodule using Hugo theme
[[TTURLCache sharedCache] removeAll:YES];?
I have created thumbnail view using Three20 bundle. I have successfully loaded and displayed the images in the view. Now i want to clear the cache images because everytime it shows only the previously cached image and not the updated or latest image. All images are retrieved from the RSS feed.Please help me out.Thanks.
How to clear cache image?
I simply ignored the issue by tacking on;exit 0on the offending lines. Not great, but does the job.EDIT: This worked for me as I cannot upgrade the version of CemtOS. If you can, check out Alexander Block's answer.
I am trying to build using:FROM mcr.microsoft.com/dotnet/core/sdk:2.1 AS builder COPY pythonnet/src/ pythonnet/src WORKDIR /pythonnet/src/runtime RUN dotnet build -f netstandard2.0 -p:DefineConstants=\"MONO_LINUX\;XPLAT\;PYTHON3\;PYTHON37\;UCS4\;NETSTANDARD\" Python.Runtime.15.csproj # copy myApp csproj and restore COPY src/myApp/*.csproj /src/myApp/ WORKDIR /src/myApp RUN dotnet restore # now copy everything else as separate docker step # (copy to staging folder, remove csproj, and copy down - so we don't overwrite project above) WORKDIR / COPY src/myApp/ ./staging/src/myApp RUN rm ./staging/src/myApp/*.csproj \ && cp -r ./staging/* ./ \ && rm -rf ./stagingThis was working fine, and in Windows 10 still does, but in CentOS 7 I get:Step 10/40 : RUN rm ./staging/src/myApp/*.csproj && cp -r ./staging/* ./ && rm -rf ./staging ---> Running in 6b17ae0fae89 cp: cannot stat './staging/src/myApp/myApp.csproj': No such file or directoryUsinglsinstead ofcpthrows a similar file not found error, so it looks like Docker still knows aboutmyApp.csprojbut cannot see it since it has been removed.Is there a way around this? I have tried usingrsyncbut similar problems.
Why is docker not completely deleting my file?
I don't know how exactly cAdvisor works but making a parallel with howNode_Exporterdoes, I think there are more CPU modes besides "user" and "system" to add up to the total CPU usage.Look at the all Node_Exporter CPU modes available:# HELP node_cpu_seconds_total Seconds the cpus spent in each mode. # TYPE node_cpu_seconds_total counter node_cpu_seconds_total{cpu="0",mode="idle"} 5.96744154e+06 node_cpu_seconds_total{cpu="0",mode="iowait"} 6523.35 node_cpu_seconds_total{cpu="0",mode="irq"} 0 node_cpu_seconds_total{cpu="0",mode="nice"} 936.5 node_cpu_seconds_total{cpu="0",mode="softirq"} 8087.39 node_cpu_seconds_total{cpu="0",mode="steal"} 21.29 node_cpu_seconds_total{cpu="0",mode="system"} 33360.63 node_cpu_seconds_total{cpu="0",mode="user"} 862602.25
I am struggling to understand some concepts regarding the cAdvisor metrics (when scraped by Prometheus) specifically the cpu usage metrics.It provides the following three metric types concerning CPU usage:container_cpu_system_seconds_total: Cumulative system cpu timeconsumed container_cpu_user_seconds_total: Cumulative user cpu timeconsumed container_cpu_usage: Cumulative usage cpu time consumedI thought to get the percentage (* 100) of the respective CPU when I take the rate of them. For example with following PromQL:sum by (pod) (container_cpu_usage_seconds_total)However, the sum of the cpu_user and cpu_system percentage values do not add up to the percentage value of the cpu_usage. If this is an expected difference what does this difference represent?
PromQL to correctly get CPU usage percentage
I have opencv-3.4 built with cuda-10.0 and the following code works fine on my ubuntu-16.04 system. #include <iostream> #include <iomanip> #include "opencv2/objdetect.hpp" #include "opencv2/highgui.hpp" #include "opencv2/imgproc.hpp" #include "opencv2/cudaobjdetect.hpp" #include "opencv2/cudaimgproc.hpp" #include "opencv2/cudawarping.hpp" #include <opencv2/cudaarithm.hpp> #include <stdio.h> using namespace std; using namespace cv; using namespace cv::cuda; int main() { cv::Mat im_in = cv::imread( "test.png" ); //upload image to GPU cv::cuda::GpuMat gpu_im ; gpu_im.upload( im_in ); // RAM => GPU //Rotate from 90 cv::Size size = im_in.size(); cv::cuda::GpuMat gpu_im_rot ; cv::cuda::rotate( gpu_im, gpu_im_rot, cv::Size( size.height, size.width ), -90, size.height-1, 0, cv::INTER_LINEAR ); gpu_im_rot.download(im_in); //GPU => RAM cv::imwrite( "out.png", im_in ); }
I'm using gpu::rotate from opencv lib to rotate clockwize an image. #include <opencv2/core/core.hpp> #include <opencv2/highgui/highgui.hpp> #include <opencv2/imgproc/imgproc.hpp> #include <opencv2/gpu/gpu.hpp> int main() { cv::Mat im_in = cv::imread( "test.png" ); //upload image to GPU cv::gpu::GpuMat gpu_im ; gpu_im.upload( im_in ); // RAM => GPU //Rotate from 90 cv::Size size = im_in.size(); cv::gpu::GpuMat gpu_im_rot ; cv::gpu::rotate( gpu_im, gpu_im_rot, cv::Size( size.height, size.width ), -90, size.height-1, 0, cv::INTER_LINEAR ); gpu_im_rot.download(im_in); //GPU => RAM cv::imwrite( "out.png", im_in ); } Input Image Output Image I have always black line, I have tested multiple shift coordinate, and interpolation method. I cannot find real cuda corresponding code in opencv source opencv\modules\gpu\src\imgproc.cpp
Rotate image with opencv GPU
There are two fundamental mistakes in your observation. you cannot delete an object, only references. If you delete a you delete the pointer. When you delete all pointers then only the object might get deleted at some point by the garbage collector sys.getsizeof only gives the size of the container. To get the total size you need to loop over the elements and sum. Demonstration that the size is roughly the same: b = {} for ii in range(1000): b[f'{ii}']=a[:,ii].copy() sum(sys.getsizeof(e) for e in b.values()) # 4096000
I am trying to find a memory efficient way to store data in python variables for quick access and analysis. I initialize an 2d array in numpy and then find its memory usage (using sys so I can compare to other variable types later) via the following: a = np.zeros((1000,1000), dtype=np.float32) print('The size of the numpy array is {} bytes'.format(sys.getsizeof(a))) Which returns: The size of the numpy array is 4000112 bytes I can move this into a dictionary of 1d numpy arrays using the following for-loop: b = {} for ii in range(1000): b[f'{ii}']=a[:,ii] print('The size of the dictionary is {} bytes'.format(sys.getsizeof(b))) Which returns: The size of the dictionary is 36968 bytes. The dictionary size persists even if I delete a and run garbage collection, so b can't just be a container pointing to a. Why would a dictionary of 1d arrays take up less memory than those same arrays in an ndarray?
Does a dictionary of numpy arrays really use less memory than an ndarray?
docker-compose up -d postgresrefers to this part of thedocker-compose.yamlfile:services: postgres: image: "openmaptiles/postgis:2.9" volumes: - pgdata:/var/lib/postgresql/data networks: - postgres_conn ports: - "5432" env_file: .env ...As you can see in theports:section, there is nocontainer - hostport mapping here. To access this postgres database from your host try using"5432:5432". (notice that if you're already using this port on the host, you will have to pick an available one).For more information on the docker-compose file reference and ports, check thedocs.
I am currently playing around with openmaptiles (https://github.com/openmaptiles/openmaptiles) and I'd like to figure out how to import my own data into the resulting mbtiles. But first I'd like to look at how the postgres database it is using is structured. I just can't figure out how I can connect to the postgres database using my GUI tool I have running locally.I start postgres using the command provided on the help page:docker-compose up -d postgres. Is it just not visible to outside of the docker container (I am also very new to docker)? And is there a way to make it visible to my local system?
How to connect to OpenMapTiles Docker Postgres DB
You have a timeout problem. Tackling it HTTP/1.1 502 Bad Gateway Indicates, that nginx had a problem to talk to its configured upstream. http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#502 2013/02/12 07:36:16 [error] 32401#0: *1948 upstream prematurely closed connection while reading response header from upstream Nginx error log tells you Nginx was actually able to connect to the configured upstream but the process closed the connection before the answer was (fully) received. Your development environment: Completed 200 OK in 15663ms Apparently you need around 15 seconds to generate the response on your development machine. In contrast to proxy_connect_timeout, this timeout will catch a server that puts you in it's connection pool but does not respond to you with anything beyond that. Be careful though not to set this too low, as your proxy server might take a longer time to respond to requests on purpose (e.g. when serving you a report page that takes some time to compute). You are able though to have a different setting per location, which enables you to have a higher proxy_read_timeout for the report page's location. http://wiki.nginx.org/HttpProxyModule#proxy_read_timeout On the nginx side the proxy_read_timeout is at a default of 60 seconds, so that's safe I have no idea how ruby (on rails) works, check the error log - the timeout happens in that part of your stack
Application details : Rails 3.1.0 Ruby 1.9.2 unicorn 4.2.0 resque 1.20.0 nginx/1.0.14 redis 2.4.8 I am using active_admin gem, for all URL's getting response 200, but only one URL giving 502 error on production. rake routes : admin_links GET /admin/links(.:format) {:action=>"index", :controller=>"admin/links"} And its working on local(development). localhost log : response code 200 Started GET "/admin/links" for 127.0.0.1 at 2013-02-12 11:05:21 +0530 Processing by Admin::LinksController#index as */* Parameters: {"link"=>{}} Geokit is using the domain: localhost AdminUser Load (0.2ms) SELECT `admin_users`.* FROM `admin_users` WHERE `admin_users`.`id` = 3 LIMIT 1 (0.1ms) SELECT 1 FROM `links` LIMIT 1 OFFSET 0 (0.1ms) SELECT COUNT(*) FROM `links` (0.2ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM `links` LIMIT 10 OFFSET 0) subquery_for_count CACHE (0.0ms) SELECT COUNT(count_column) FROM (SELECT 1 AS count_column FROM `links` LIMIT 10 OFFSET 0) subquery_for_count Link Load (0.6ms) SELECT `links`.* FROM `links` ORDER BY `links`.`id` desc LIMIT 10 OFFSET 0 Link Load (6677.2ms) SELECT `links`.* FROM `links` Rendered /usr/local/rvm/gems/ruby-1.9.2-head/gems/activeadmin-0.4.2/app/views/active_admin/resource/index.html.arb (14919.0ms) Completed 200 OK in 15663ms (Views: 8835.0ms | ActiveRecord: 6682.8ms | Solr: 0.0ms) production log : 502 response Started GET "/admin/links" for 103.9.12.66 at 2013-02-12 05:25:37 +0000 Processing by Admin::LinksController#index as */* Parameters: {"link"=>{}} NGinx error log 2013/02/12 07:36:16 [error] 32401#0: *1948 upstream prematurely closed connection while reading response header from upstream don't know what's happening, could some buddy help me out.
502 error nginx + ruby on rails application
I don't believe you're guaranteed to get the info you're looking for, however we can try.Find the latest Helm secret for your Helm release.kubectl get secret -n msgbox-lucyYours might look something like this:sh.helm.release.v1.msgbox-lucy.v5and run this command to view the chart's metadata:SECRET_NAME="sh.helm.release.v1.msgbox-lucy.v5" kubectl get secret $SECRET_NAME -o json | jq .data.release \ | tr -d '"' | base64 -d | base64 -d | gzip -d \ | jq '.chart.metadata'The metadata should hopefully show you 2 things you're looking for. The chart name will be under thenamefield. The chart repository URL might be undersources.I say "might" because the chart developer should have added it there, but they might not have.Then you can match the URL to your repo alias.If it's not included in the metadata, you're probably out of luck for now.There is an open Github issue about exactly this feature you're wanting:https://github.com/helm/helm/issues/4256And an open PR that adds that feature:https://github.com/helm/helm/pull/10369And an open PR to add a HIP (Helm Improvement Proposal) for adding that feature:https://github.com/helm/community/pull/224ShareFollowansweredAug 12, 2022 at 3:35ericfossasericfossas1,96199 silver badges1414 bronze badges1Thanks mate, I tried and luck wasn't on my side, I will wait final solution–Bryan ChenAug 12, 2022 at 7:43Add a comment|
I have many helm repositories in my kubernetes, And I installed a lot of charts, So How do I know which repository the installed Chart belongs to? For example:$> helm repo list NAME URL lucy-dev https://harbor.mydomain.net/chartrepo/lucy-dev lucy-prod https://harbor.mydomain.net/chartrepo/lucy-prod $> helm ls -n msgbox-lucy -o yaml - app_version: "1.0" chart: msgbox-lucy-8.27.3 name: msgbox-lucy namespace: msgbox-lucy revision: "48" status: deployed updated: 2022-04-19 08:11:16.761059067 +0000 UTCI can't usehelm showbecause:$> helm show all msgbox-lucy -n msgbox-lucy --debug show.go:195: [debug] Original chart version: "" Error: non-absolute URLs should be in form of repo_name/path_to_chart, got: msgbox-lucy ...
How do I know which repository the installed Chart belongs to
3 You might want to look at this article https://help.github.com/articles/remove-sensitive-data Pretty much says this command git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch Rakefile' \ --prune-empty --tag-name-filter cat -- --all Will remove the history of Rakefile from git. However, they go ahead and add that file to their gitignore. You should probably skip that part since you want to keep the file in version control. Share Improve this answer Follow answered Mar 21, 2013 at 1:38 Leo CorreaLeo Correa 19.3k22 gold badges5454 silver badges7171 bronze badges 5 1 An explanation of what that actually does would be great. – user3467349 Jul 8, 2014 at 7:44 5 The linked article explains how to remove a file. The OP's question title says to not remove a file. – Tyler Collier Mar 14, 2015 at 16:32 @TylerCollier if you read my answer it states not to add the file to gitignore since that will take it out of version control. This will remove the file from history thus allowing the sensitive data to be removed. – Leo Correa Mar 15, 2015 at 0:14 5 The OP already knows how to do that: I'm only seeing how to remove the file itself from version control and clear its history. I think he wants to remove only the sensitive information from the history, but not the history itself. – Tyler Collier Mar 15, 2015 at 5:19 Holy crap. Whatever happened to a simple right click remove history. Insanely complex. Can't get it to work. Keep getting messages stating it remains unchanged. – Koen Zomers Jun 9, 2015 at 11:08 Add a comment  | 
This question already has answers here: Remove sensitive files and their commits from Git history (12 answers) Closed 10 years ago. I have a file that once contained sensitive config information. I move that config info out into another file that isn't under version control. I want to keep the other file under version control, but I want to remove its history because one can easily browse the source on github and find the sensitive information in previous commits. What's the best way to do this? I'm only seeing how to remove the file itself from version control and clear its history. A little new to git, so pardon the newbieness.
remove sensitive data but not file from git history [duplicate]
It is now possible to create Athena Table in CloudFormation through the Glue Data Catalog:https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-glue-table.html
Is there any way to create DataBase and Table in Amazon Athena using CloudFormation. I referred to AWS documentation and there seems to be only one resource which can be created using CloudFormation.Ref :https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-template-resource-type-ref.htmlhttps://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-athena-namedquery.html
How can we create database and table in Amazon Athena using CloudFormation
The main purpose for multi-GPU learning is to enable you train on large data set in shorter time. It is not necessarily better with larger mini-batch, but at least you can finish learning in a more feasible time. More precisely, those N mini-batches are not trained in a synchronized way if you use Asynchronous SGD algorithm. As the algorithm changes when using multi-GPU, it is not equal to using MxN size mini-batch on single-GPU with SGD algorithm. If you use sync multi-GPU training, the benefit is mainly time reduction. You could use M/N-size mini-match to maintain the effective mini-batch size, and of course the scalability is limited as smaller mini-batch size leads to more overhead. Data-exchange and synchronization on large number of computing nodes are also disasters. Finally to solve the scalability issue, people move to A-SGD when using large number of GPUs concurrently. So probably you won't see someone using sync multi-GPU training on hundreds of (or even tens of) GPUs.
In this TensorFlow tutorial, you can use N number of GPUs to distribute N mini-batches (each containing M training samples) to each GPU and calculate the gradients concurrently. Then you average the gradients collected from N GPUs and update the model parameters. But this has the same effect as using a single GPU to calculate the gradients of N*M training samples, then updating the parameters. So the only advantage seems to me is that you can use a larger-sized mini-batch in the same amount of time. But is the larger-sized mini-batch necessarily better? I thought you shouldn't use a large-sized mini-batch, in order to make the optimization more robust to saddle points. If the larger-sized mini-batch is indeed not better, why would you care about Multi-GPU learning, or even Multi-server learning? (The tutorial above is a synchronous training. If it was asynchronous training, then I can see the merit, since the parameters will be updated without averaging the gradients calculated by each GPU)
What is the advantage of doing a Multi-GPU training in TensorFlow?
You should to install ROK on Your Kubernetes cluster. Without ROK you can't use it
I am trying to integrate kubeflow kale in jupyterlab. For that, I have installed the recommeded package using the below commandRUN pip3 --no-cache-dir install \ --upgrade pip \ urllib3==1.24.3 \ jupyter-client==6.1.5 \ nbformat==5.0.2 \ six==1.15 \ numpy==1.17.3 \ jupyter-console==6.0.0 \ jupyterlab==1.1.1 \ jupyterthemes \ xgboost \ kubeflow-fairing==1.0.0 \ [![enter image description here][1]][1]kubeflow-kale # Kale installation RUN jupyter labextension install kubeflow-kale-launcherThe docker image was build successfully. When I run this jupyterlab in the cluster I am getting the below errorDetails: Rok Gateway Client module not foundDo I need to install any other plugins?Please help anyone to fix this problem. Thanks in advance
Kubeflow kale failed to connect Rok module
curl failed to connect to that host's TCP port number 80. You're either not running the http server on port 80, you've made curl try to connect to the wrong server or there's something else in your network that prevents the connect handshake to succeed.
I have a website (www.example.com | 123.456.789), in that machine i only have 1 web app running. i am trying to use php file_get_content() to a file which in my own server (located on some file like /var/www/my_site/public_html).The PHP code i am referring is:$url = 'http://example.com/282-home_default/short-wallet-tan.jpg'; var_dump($url); $json = @file_get_contents($url); var_dump($json); die();However it always returns error. When i try to do it manually, using CURLI can confirm that i can CURL other website such as~$ curl google.comCan anyone suggest me what to do to resolve this. ThanksI am using Ubuntu 14.04 LTS to host my webapp.Some of the solution regarding this question, points out that i should downgrade my version of curl. Did that but still have the same problem.
Curl Error Hostname Not Found in DNS Cache
The following steps solved this problem:Open cmd as administratorLaunch command:"C:\Program Files\Docker\Docker\DockerCli.exe" -SwitchDaemon
I am new to Docker and after writingdocker versionin cmd I got this error, 35026667 error during connect: This error may indicate that the docker daemon is not running.: Get"http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.24/version": open //./pipe/docker_engine: The system cannot find the file specified.
error during connect: This error may indicate that the docker daemon is not running
Q. If I want to send push notification to my phone, which one should I use?A. Both Amazon SNS and Amazon Pinpoint, support push notification feature and I normally like classifying them as"Mobile Push Messaging"tools however they differ in mechanism as discussed below.The major difference between Amazon SNS & Amazon Pinpoint is addressed by thePinpoint FAQQ: I already use Amazon SNS or Amazon SES. What do I gain by switching to Amazon Pinpoint?In typical Amazon SNS and Amazon SES use cases, you have to set up your application to manage each message's audience, content, and delivery schedule. These same features are built in to Amazon Pinpoint. With Amazon Pinpoint, you can create message templates, delivery schedules, highly-targeted segments, and full campaigns.Some of the key features offered by Amazon Pinpoint(i.e currently not offered by Amazon SNS)are:Supportstwo-way messagingUnderstand User BehaviorSupportsvoice messagesCreate Targeted CampaignsSupports.p8 token authenticationfor APNsMeasure ResultsHope this helps
I am new to Push Notification and really interested in it. We have AWS SNS (Simple Push Notification) and AWS Pinpoint.I am confuse about these services from AWS.What is the difference between them?If I want to send push notification to my phone, which one should I use?If you have any ideas, please let me know.Thank you in advanced!
What is the difference between AWS Pinpoint and AWS SNS?
It's not a direct answer to how to install the certbot dnsmadeeasy plugin but it worked for me so I went with this solution.I used their Docker image -https://hub.docker.com/r/certbot/dns-dnsmadeeasyIt works the same as certbot with the dnsmadeeasy plugin installed so you can obtain a certificate by running:docker run --rm -it --name certbot-dnsmadeeasy \ -v {path_to_your_dnsmadeeasy.ini}:/dnsmadeeasy.ini \ -v {path_to_where_you_want_to_store_certs}:/etc/letsencrypt \ certbot/dns-dnsmadeeasy certonly \ --dns-dnsmadeeasy \ --dns-dnsmadeeasy-credentials /dnsmadeeasy.ini \ -d {yourdomain}You don't even need to have certbot installed on your machine.
I'm on Ubuntu 16.04 and I want to get a wildcard certificate and my DNS provider is in the list -https://certbot.eff.org/docs/using.html#dns-pluginsBut when I try to do step5. Install correct DNS pluginsudo apt-get install python3-certbot-dns-dnsmadeeasyI always getUnable to locate package python3-certbot-dns-dnsmadeeasythough I can see it on thecertbot github pageI can't get how to install this plugin to use with certbot.
How to install certbot DNS plugin for DNS Made Easy?
You are dealing with two levels of abstraction here. Everything accessed within the program is in the virtual address space, and the .data/.bss sections are available at the beginning of program execution. A deeper abstraction is that the virtual address space is backed by physical memory using paging, managed by the memory manager. This is totally unknown to the executing code and code that loads the process. So it's possible at this level that parts of .data/.bss (or even your code) are not present in main memory because the physical pages have not been loaded, in general these will be loaded on demand as their corresponding virtual addresses are referenced. Google things like "memory management", "virtual memory", "paging" for more information.
Usually, the static and global variables are both stored in the .data or .bss section according to their initialization condition. It is said their life time is from the beginning to the ending of the program, and it is also known that program is loaded into the memory as a page when demanded in paging management. Does this mean .data and .bss section should both be loaded into the memory before their access, or before the first instruction goes?
Should the static or global data which is stored in .data or .bss section be loaded before the program executing?
Yes, the tab controller owns an array of view controllers (and everything in an array is retained). You're not creating a leak as long as you properly release or autorelease the items you're adding to the tabBarItems array. It really helps to think of object relationships as ownerships.
This may sound a newbie question ... but however I'm new to iOS development. I've created UITabController object programmatically like this. mTabBarController = [[UITabBarController alloc] init]; ... mTabBarController.viewControllers = [NSArray arrayWithArray:tabBarItems]; [tabBarItems release]; And releasing mTabBarController in dealloc like this. - (void)dealloc { [mTabBarController release]; } Now my question : will I get a memory leak ? When I assign value t viewController the ref count of tabBarItems is still 1. When I release mTabBarController does it also release all its viewcontrollers ?
How correctly release UITabController
The error was the result of a previous edit that I had made to .Rprofile while creating a website with theblogdownpackage. I didn't remember doing this, but clearly it was interfering with package downloads.After runningfile.edit(".Rprofile"), deleting the single line it contained, and then restarting R, packages are installing again.
I cannot install any R packages from Github, though I've done this several times before. I've tried this with both R Versions 3.5.0 and 3.5.1.Attempting to install "https://github.com/rstudio/bookdown/bookdown-master.zip" using:devtools::install_github('rstudio/bookdown') githubinstall::githubinstall("bookdown")or downloading and trying to load locally...install_local("/Users/Brian/Documents/bookdown-master.zip")always gives me the error messageError in readLines(f) : (converted from warning) incomplete final line found on '/Users/Brian/.Rprofile'I've tried other workarounds, as well, but all roads seem to lead to this error message, and I can't find anything that would tell me what it relates to.Any ideas?
cannot install packages from github - uninterpretable error message
Or, using plain "docker ps" instead of "awk"... note "--format" is normally used with "docker inspect":docker stats $(docker ps --format '{{.Names}}')2017-02-12 See manat's answer below (https://stackoverflow.com/a/42060599/72717). Docker 1.13.0 "stats" can display the container name in "--format":docker stats --format "table {{.Name}}\t{{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}"
I want to display state of all running container, so I could achieve it like the following:docker stats $(docker ps -q)CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O 04cdc87ba3cf 0.03% 468.8 MiB/3.784 GiB 12.10% 6.827 KiB/10.2 KiB 7d30fcbd8b36 0.09% 88.09 MiB/3.784 GiB 2.27% 28.23 KiB/289.2 KiB a09ef63b2c59 97.94% 271.5 MiB/512 MiB 53.03% 3.644 MiB/190.2 KiB a29681c1980f 0.10% 9.066 MiB/3.784 GiB 0.23% 2.538 KiB/648 Bbut the column container is only showing the container id. I need the container name though. For example:docker stats lrlcms_web_1CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O lrlcms_web_1 0.09% 88.1 MiB/3.784 GiB 2.27% 28.85 KiB/289.2 KiBSo how do I get all the container names? Just for:docker stats `all container's name'For example:docker stats lrlcms_db_1 lrlcms_redis_1CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O lrlcms_db_1 0.05% 450.3 MiB/3.784 GiB 11.62% 8.737 KiB/10.2 KiB lrlcms_redis_1 0.08% 7.383 MiB/3.784 GiB 0.19% 4.448 KiB/648 B
Is there any way to display container names in docker stats?
There's something wrong with routing. This question may solve your issue:PHP Laravel Routing IssueTry all of the suggestions, especially the ones concerning apache config.
I'm trying to get wordpress and laravel to run side-by-side and hitting a small issue.Here's my code# BEGIN Laravel <IfModule mod_rewrite.c> Options -MultiViews RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^/?admin/?.*$ index.php [L] </IfModule> # END Laravel # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /wp-index.php [L] </IfModule> # END WordPressthe wordpress pages work, apart from the homepage and the admin pages work (laravel), apart from if there is no '/' at the end.Any ideas?regards
htaccess - laravel with WordPress
You need to disable theci triggerfrom the pipeline:# A pipeline with no CI trigger trigger: none
I am making some changes in my project code and posting it to GitHub. This causes my Azure Pipeline to be triggered every time. How can I restrict pipeline triggering. I'm using Azure DevOps.
How do I restrict pipeline triggering
PoSh is just a wrapper here. For learning what SMO classes and methods are available, you need to look at the SMO documentation. Start with SQL Server Management Objects (SMO) Programming Guide. For a list of all classes in SMO, again I reffer you to the product documentation, please look at SQL Server Management Objects Reference (the list on the left hand side has all the SMO namespaces, click on each namespace to see all classes available in each namespace).
I am trying to learn powershell, recently i was struck in the query that how can find out the objects in the assembly's example: I have loaded the Powershell sql assembly [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.sqlserver.smo") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.sqlserver.smoextended") | Out-Null For denoting the server, I need to add New-Object ("Microsoft.sqlserver.Management.SMO.Server") For backup database New-Object ("microsoft.sqlserver.management.smo.backup") My question is how can I get all the objects list and to use in script.
Powershell SMO objects
The general procedure is:Run nodetool drain (http://www.riptano.com/docs/0.6/utilities/nodetool#nodetool-drain) on the nodeRun nodetool snapshotKill the cassandra processStart the cassandra processWhen running nodetool snapshot, it is very important that you have JNA set up and working. This includes:Having jna.jar in Cassandra's lib directory and either:Running Cassandra as root, orIncreasing the memory locking limit using 'ulimit -l' or something like /etc/security/limits.confIf this is all correct, you should see a message about "mlockall" succeeding in the logs on startup.The other thing to keep an eye on is your disk space usage; this will grow as compactions occur and the old SSTables are replaced (but their snapshots remain).
Being a level 1 novice in Linux (Ubuntu 9), shell and cron, I've had some difficulty figuring this out. Each night, I'd like to take a snapshot of our Cassandra nodes and restart the process.Why? Because our team is hunting down a memory leak that requires a process restart every 3 weeks or so. The root cause has been difficult to track down. In the meantime, I'd like to put these cron jobs in place to reduce service interruption.Thanks in advance for anyone who has some of these already figured out!
Cassandra Snapshot and Restart
If yourusername.github.iorepo is public, then you could access the styling file(s) from any other repo.Inusername.github.io, let's say there's a fileusername.github.io/styling/main.css. In your layouts for any other projects, you can link to the file like a regular external css link:<link rel="stylesheet" href="https://raw.githubusercontent.com/username/username.github.io/styling/main.css">raw.githubusercontent.comhasAccess-Control-Allow-Origin=*. It accepts all incoming CORS requests, so you don't have to worry about CORS issues. Also,<link>tags get the respective files usingGETrequests, which don't trigger CORS preflight requests.
I would like all my project pages to have the same custom style. But for now I only see that every project page can be configured separately (choosing default theme from Setting of the project or creatinggh-pagesbranch with the source files).Is there any way to archive what I want? For example, to write custom style in myusername.github.iorepo and all project could use that styles to create pages underusername.github.io/projectnamewith the provided custom styles.
Same style for all project github pages?
No, it's not necessary. Likeeyllanescsaid just make a new branch on the fork and make the PR pulling the changes from that new branch.
I created a pull request from my fork of the repository. I had made 10 commits to my fork for the pull request which was later merged.Now when I want to work on another issue my fork still shows that it is 10 commits ahead of the main repository even though the PR was merged. I deleted my fork of the repository and forked the repository again. Now it shows my fork is up to date with the main repository (as expected).So my question is do I need to delete my fork and create new fork of main repository for every new pull request?
Is it necessary to fork again for future PRs?
You can specify--no-fixso that it doesn't autofix errors/warnings and set--max-warningsto0as it seems you have one warning in your project and want it treated as an error.In yourpackage.json:{ .... "scripts": { "lint": "vue-cli-service lint --no-fix --max-warnings 0", .... } }checkout documentationLog output:warning: Delete `⏎········` (prettier/prettier) at src/components/QuestionInfo.vue:5:25: 3 | <div class="question_card container"> 4 | <BaseTag > 5 | :class="['tag', | ^ 6 | 'p-5', 'pb-0', 'pl-0', 'ml-5']" 7 | :tag-name="this.tag" 8 | /> 1 warning found. 1 warning potentially fixable with the `--fix` option. Eslint found too many warnings (maximum: 0).
I'm usingGithub Actionsfor the first time. I'm usingVue-CLI& I want to create a job that lint my files onpush& breaks the build process if there'sESLint'errors.This is mypackage.json's scripts:"scripts": { "serve": "vue-cli-service serve", "build": "vue-cli-service build", "lint": "vue-cli-service lint", },This is my.github/workflows/main.ymlfile:name: Lint files on push on: push jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Install modules run: npm install - name: Run ESLint run: npm run lintI was usingthis templateas inspiration. As you see in the screenshot below. The job is finished successfully, but it doesn't break the build or either fixes the linting. What am I doing wrong?
ESLint doesn't break build with Github Actions
I intend to keep the two as seperate repos so what are my options? Clone two times (just copy the 1st local clone to a different directory). In the 1st clone remove server subdirectory, in the 2nd remove client. cloning locally and uploading to a new repo feels slightly unethical to me. Shouldn't be a problem if the license allows it. I would mention the source repo in the readme in this case. That's enough, I'm sure.
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago. Improve this question I intend to bootstrap my own project from an available open source project. Ideally I would have forked it and renamed the repository but the source repository consists of two folders. One for the client app and one for the server app. I intend to keep the two as seperate repos so what are my options? cloning locally and uploading to a new repo feels slightly unethical to me. I would mention the source repo in the readme in this case. I do not intend to bring over any new changes most likely.
Bootstrapping from a fork of a repository [closed]
The docsheredefine the meaning of what Kubernetes considers as 1 CPU. 1 AWS vCPU is equivalent to 1 CPU unit in Kubernetes.
Im trying to set resource limits on some of the deployments in my k8 cluster in AWS,but i was little confused with the relation between Ec2 vcpu vs actual cores.actaully im running a prometheus components as multiple pods ,so how can i derive the resource limit values for prometheus pods?Like how to derive memory & cpu numbers for request and limit
AWS 1 vcpu is equal to how many cores?
2 A blog post explaining memory leak issue with LinkedHashMap in multi-thread context https://hoangx281283.wordpress.com/2012/11/18/wrong-use-of-linkedhashmap-causes-memory-leak/ Share Improve this answer Follow answered Apr 8, 2014 at 3:35 Hoang TOHoang TO 6144 bronze badges Add a comment  | 
I'm trying to use LinkedHashMap as a local FIFO cache solution overwriting its removeEldestEntry method to keep size fixed: Map lhm = new LinkedHashMap(MAX_CACHE_SIZE + 1, .75F, false) { protected boolean removeEldestEntry(Map.Entry eldest) { return size() > MAX_CACHE_SIZE; } }; but when I constantly add new entries to the map monitoring process memory I see it keeps growing until max virtual machine memory is used though map size doesn't increase. Is it by design? Why does it need more memory if old values are discarded and size of the map is limited? UPDATE: as requested I'm attaching full code: @Test public void mapMemory() { final int MAX_CACHE_SIZE = (int) 1E3; Map lhm = new LinkedHashMap(MAX_CACHE_SIZE + 1, 1F, false) { protected boolean removeEldestEntry(Map.Entry eldest) { return size() > MAX_CACHE_SIZE; } }; for (long i = 0; i < 1E10; i++) { lhm.put("key_" + i, "VALUE"); } }
Fixed size LinkedHashMap memory leak?
Answer is Yes and No. The question is very similar to Is it possible to add/remove/edit the Environment variables after the container instance has been created? You can update the variables however it will end up recreating the container or "Redeploying" it with the update variables which in turns terminates the container and deploys a new one.
I am creating a container so my developers can run some e2e on their created features. The container have a environment variable that is pointing to their URL that they want to run the test. This URL is randomly generated every time. I am looking to change this environment variable of an existing container in Azure Container Instances from CLI. Is there any way to do this?
Azure Container Instances change environment variable on start
You would see the same in any file part of a commit referenced by multiple tags.The goal is to list all the tags referencing that commit.You can then see:when said commit was first taggedits most recent tag.Consider for instancegit/gitcommit 799767c:Click on the '...' part and:
I'm currently attempting to migrate a large amount of software releases to GitHub from a legacy system (ClearCase). While doing so, I've created this workflow:Read label from ClearCaseGenerate and apply config spec via labelRobocopy files/directories from ClearCase to pre-cloned/initialized git repositoryStage all files to be added in GitCreate a commitTag this commitPush commit and tags to GitHubAfter pushing some tags to GitHub, I navigated to My Repository -> Releases, and looked at one of the most recent tags pushed. To my surprise, not only was the tag that I expected to be present there, but also a number of other previous tags from commits earlier in the master branch (all of the releases are being added to the master branch in order.)Why is there a plethora of tags being applied to the same release? Am I reading the release wrong? I've included a screenshot of an example of how I'm seeing the multiple tags:
Multiple Git Tags Appear In Software Release on GitHub
git update-index --no-assume-unchanged application/config/config.php Notice the --no prefix, stylistically a double negation.
I just did the following to to keep a different copy of my config.php file in my localhost vs. my production environment: $ git update-index --assume-unchanged application/config/config.php Unfortunately, I didn't write the config.php file exactly as I should and I need to reverse this such that I can make the change, commit it, and then re-ignore the file. How do I undo the git update-index command?
How to undo git update-index?
The simplest possible manifest that you need to write in order to run a pod.
What is Minimum Viable Pod (MVP) in kubernetes?i've tried to google it but nothing useful was there...i've heard about the MVP consept when i sawthisyaml file and couldn't get what is MVP and why this pod is a MVP!
what is Minimum Viable Pod (MVP)
MongoDB is not supported currently. Only a certain set of DBs are supported.Storageoptions in LokiThe following are supported for the index:Single Store (boltdb-shipper) - Recommended for 2.0 and newer index store which stores boltdb index files in the object storeAmazon DynamoDBGoogle BigtableApache CassandraBoltDB (doesn’t work when clustering Loki)The following are supported for the chunks:Amazon DynamoDBGoogle BigtableApache CassandraAmazon S3Google Cloud StorageFilesystem
I was going through the loki documentation. And i came across storage section, where you can set the storage to be any DB/FileSystem/InMemory. Currently, i need to store the logs into MongoDB. How can i do it?Loki ConfigurationI don't see any configuration file to store the logs to MongoDB. Is there any reference/configuration file which could help me set these loki chunks and indexes to be stored in MongoDB?
Loki Configuration for MongoDB storage
Sometime flannel will change it's subnet configuration... you can tell this if the IP and MTU fromcat /run/flannel/subnet.envdoesn't matchps aux | grep docker(orcat /etc/default/docker)... in which case you will need to reconfigure docker to use the new flannel config.First you have to delete the docker network interfacesudo ip link set dev docker0 down sudo brctl delbr docker0Next you have to reconfigure docker to use the new flannel config.Note: sometimes this step has to be done manually (i.e. read the contents of /run/flannel/subnet.env and then alter/etc/default/docker)source /run/flannel/subnet.env echo DOCKER_OPTS=\"-H tcp://127.0.0.1:4243 -H unix:///var/run/docker.sock --bip=${FLANNEL_SUBNET} --mtu=${FLANNEL_MTU}\" > /etc/default/dockerFinally, restart dockersudo service docker restart
So I have a Kubernetes cluster, and I am using Flannel for an overlay network. It has been working fine (for almost a year actually) then I modified a service to have 2 ports and all of a sudden I get this about a completely different service, one that was working previously and I did not edit:<Timestamp> <host> flanneld[873]: I0407 18:36:51.705743 00873 vxlan.go:345] L3 miss: <Service's IP> <Timestamp> <host> flanneld[873]: I0407 18:36:51.705865 00873 vxlan.go:349] Route for <Service's IP> not foundIs there a common cause to this? I am using Kubernetes 1.0.X and Flannel 0.5.5 and I should mention only one node is having this issue, the rest of the nodes are fine. The bad node's kube-proxy is also saying it can't find the service's endpoint.
L3 miss and Route not Found for flannel
You can usegit diff --name-only $$CODEBUILD_RESOLVED_SOURCE_VERSION $$CODEBUILD_WEBHOOK_PREV_COMMITWhere$CODEBUILD_WEBHOOK_PREV_COMMITis the commit id of the previous commit. And$CODEBUILD_RESOLVED_SOURCE_VERSIONis the commit id of the actual one.Inside a build phase you can check the change with:- | if [ "$(git diff --name-only $CODEBUILD_RESOLVED_SOURCE_VERSION $CODEBUILD_WEBHOOK_PREV_COMMIT | grep -e <filde_path>)" != "" ]; then #your code; fi
I'm trying to set up an AWS CodeBuild project to run tests to validate PRs and commits on a GitHub repository.Because of the nature of the repo (a monorepo combining several ML models):I need to restrict down to only run tests associated with files changed in the PR/commit to keep time+cost under control, butThe tests will typically require reference to other un-changed files in the repo: So can't justonlypull changed files through to the build container.How can a running CodeBuild build triggered by a GitHub PR (as per the docshere) 'see' which files are changed by the PR to selectively execute tests?
How can an AWS CodeBuild job see which files have changed?
According toFeatures Supported by the Editions of SQL Server 2008 R2auditing is only available in 2008 / 2008 R2 Enterprise / Datacenter.According toFeatures Supported by the Editions of SQL Server 2012auditing has been split up in SQL Server 2012, so that basic auditing is now offered in Standard Edition.So what you're seeing is expected: prior to SQL Server 2012, auditing was an Enterprise-only feature (outside of C2/CCC, which is just sp_configure stuff that is not exposed in Object Explorer).
I will pre-cursor this with the fact that I am NOT a DBA!I am trying to set up auditing on an SQL Server 2008 R2 Standard edition, but the Audits folder is missing from the Security section.Is this a version issue associated with the "fine-grained auditing" that is only in the Enterprise and DataCenter editions?Any help is greatly appreciated!
SQL Server 2008 R2 standard missing "Audits" folder in SSMS?
No, there is no magic bullet. (As an aside, you have to realize that there is no such thing as a "directory" in S3. There are only objects with paths. You can get directory-like listings, but the '/' character isn't magic - you can get prefixes by any character you want.) As someone pointed out, "pre-zipping" them can help both download speed and append speed. (At the expense of duplicate storage.) If downloading is the bottleneck, it sounds like your are downloading serially. S3 can support 1000's of simultaneous connections to the same object without breaking a sweat. You'll need to run benchmarks to see how many connections are best, since too many connections from one box might get throttled by S3. And you may need to do some TCP tuning when doing 1000's of connections per second. The "solution" depends heavily on your data access patterns. Try re-arranging the problem. If your single-file downloads are infrequent, it might make more sense to group them 100 at a time into S3, then break them apart when requested. If they are small files, it might make sense to cache them on the filesystem. Or it might make sense to store all 5000 files as one big zip file in S3, and use a "smart client" that can download specific ranges of the zip file in order to serve the individual files. (S3 supports byte ranges, as I recall.)
If I have a directory with ~5000 small files on S3, is there a way to easily zip up the entire directory and leave the resulting zip file on S3? I need to do this without having to manually access each file myself. Thanks!
Zip an entire directory on S3
I believe you can roll your own cache dependency and use FileSystemMonitor to monitor the filesystem changes.Update: Sample code belowpublic class FolderCacheDependency : CacheDependency { public FolderCacheDependency(string dirName) { FileSystemWatcher watcher = new FileSystemWatcher(dirName); watcher.Changed += new FileSystemEventHandler(watcher_Changed); watcher.Deleted += new FileSystemEventHandler(watcher_Changed); watcher.Created += new FileSystemEventHandler(watcher_Changed); watcher.Renamed += new RenamedEventHandler(watcher_Renamed); } void watcher_Renamed(object sender, RenamedEventArgs e) { this.NotifyDependencyChanged(this, e); } void watcher_Changed(object sender, FileSystemEventArgs e) { this.NotifyDependencyChanged(this, e); } }
In ASP.NET I would like to store an object in the cache which has a dependancy on all the files in specific folder and its sub-folders. Just adding the object with a dependancy on the root folder doesn't work. Is there in any reasonable way to do this other than creating a chain of dependancies on all the files?
Create a cache dependancy on a folder and its sub-folder
The straight answer to your question is that you are misusing the $FAIL_OUTCOME value in if statements. There you need to use: if: steps.evaluation_1.outputs.evaluation-1-outcome == env.FAIL_OUTCOME || steps.evaluation_2.outputs.evaluation-2-outcome == env.FAIL_OUTCOME ... if: steps.evaluation_1.outputs.evaluation-1-outcome != env.FAIL_OUTCOME && steps.evaluation_2.outputs.evaluation-2-outcome != env.FAIL_OUTCOME or: if: ${{ steps.evaluation_1.outputs.evaluation-1-outcome == env.FAIL_OUTCOME || steps.evaluation_2.outputs.evaluation-2-outcome == env.FAIL_OUTCOME }} ... if: ${{ steps.evaluation_1.outputs.evaluation-1-outcome != env.FAIL_OUTCOME && steps.evaluation_2.outputs.evaluation-2-outcome != env.FAIL_OUTCOME }} Env variables can be accessed as $FAIL_OUTCOME only in bash scopes - everywhere else, you need to explicitly use env. prefix. However, I would recommend doing it properly and not fighting with env variables combined with set-output madness - which has a lot of gotchas and it's hard to debug and maintain. Slack success and failures can be easily handled by checking the output of the whole job: - name: send slack failure if: failure() - name: send slack success if: success() If you want to communicate about failure of some steps only: notify_failure: if: always() && !cancelled() && needs.check_failure_step.result != 'success' needs: check_failure_step And instead of using echo set-output:: just if0 to fail a certain job. Combining that with if1 and jobs output values and if2 you can achieve anything you want. It gives you also a huge advantage of seeing which job has failed straight on workflow run summary without looking to its "output" or "debug" logs.
I have the following steps' sequence in a GitHub Actions job (first one is used more or less for debugging purposes env: FAIL_OUTCOME: 'fail' - name: debug shell: bash run: | echo "evaluation-1 result is ${{ steps.evaluation_1.outputs.evaluation-1-outcome }} echo "evaluation-2 result is ${{ steps.evaluation_2.outputs.evaluation-2-outcome }} echo $FAIL_OUTCOME - name: send slack failure if: ${{ steps.evaluation_1.outputs.evaluation-1-outcome }} == $FAIL_OUTCOME || ${{ steps.evaluation_2.outputs.evaluation-2-outcome }} == $FAIL_OUTCOME uses: rtCamp/action-slack-notify@v2 env: ... - name: send slack success if: ${{ steps.evaluation_1.outputs.evaluation-1-outcome }} != $FAIL_OUTCOME && ${{ steps.evaluation_2.outputs.evaluation-2-outcome}} != $FAIL_OUTCOME uses: rtCamp/action-slack-notify@v2 env: ... Here is the outcome of the debug action: echo "evaluation-1 result is echo "evaluation-2 result is fail where it seems that first outcome is not set. However, what puzzles me is that success action is also executed, i.e. ${{ steps.evaluation_1.outputs.evaluation-1-outcome }} != $FAIL_OUTCOME && ${{ steps.evaluation_2.outputs.evaluation-2-outcome}} != $FAIL_OUTCOME becomes true. How is it possible? To provide for more context, the outputs' assignment in previous steps are as follows: echo "::set-output name=evaluation-2-outcome::$FAIL_OUTCOME"
GitHub Actions step executed while it shouldn't, based on a conditional
This looks like the standard Git on Windows line ending related issue ;-) Running the following command in the bash command line interface should fix your problem. $ git config --global core.autocrlf true See this GitHub help page for more information about this subject.
I submitted a commit with some fixes here and there, but github is not correctly showing the differences (e.g this line removed, this one added, etc). It just shows two big walls of code, one red (removed code) and one green (added code). This is not the first time it happen to me, and this last time I was extra careful to not mess with any other parts of my code. I must be doing something wrong, every free online tool I have tried shows the text differences easily. How can I prevent this from happening again? Note: in case it matters, I am using Windows and submitting them via their downloadable thingy.
Github is not showing the differences of my commits correctly
As previously mentioned, you can edit the file at$HOME\.docker\machine\machines\default\config.jsonand set the HTTP_PROXY, HTTPS_PROXY and NO_PROXY variables (or delete them):"HostOptions": { "Driver": "", ... "EngineOptions": { ... "Env": [ "HTTP_PROXY=http://10.121.8.110:8080", "HTTPS_PROXY=http://10.121.8.110:8080", "NO_PROXY=192.168.23.4" ],After the file has edited, you only have to execute:docker-machine provision
I am trying to use docker-machine to create an instance on a private cloud (Openstack) that is behind a corporate http proxy.Is it possible to tell docker-machine to use the proxy or do I need to have a glance image that is already pre-configure with the http_proxy env variable?
docker-machine behind corporate proxy
To get the metrics of container we need CADVISOR !!to setup it i just follow the procedure belowhttps://github.com/google/cadvisori installed it on each of my nodes ! i run on eachsudo docker run \ --volume=/:/rootfs:ro \ --volume=/var/run:/var/run:ro \ --volume=/sys:/sys:ro \ --volume=/var/lib/docker/:/var/lib/docker:ro \ --volume=/dev/disk/:/dev/disk:ro \ --publish=8080:8080 \ --detach=true \ --name=cadvisor \ google/cadvisor:latesti hope this will help you guys ;)
I've setup Prometheus to monitor Kubernetes. However when i watch the Prometheus dashboard I seekubernetes-cadvisorDOWNI would want to know if we need it to monitor Kubernetes because on Grafana i already get different information as memory usage, disk space ...Would it be used to monitor containers in order to makeprecise requestssuch as the use ofmemory used by a podof aspecific namespace?
do i need kubernertes-cadvisor up to monitor kubernetes
You can't add more fields to a Reference. In JaVers, a Reference is just a global identifier of an entity. Try to describe the problem you have, maybe there is a better solution than changing javers-core model.ShareFollowansweredAug 24, 2018 at 11:51Bartek WalacikBartek Walacik3,44611 gold badge1010 silver badges1414 bronze badgesAdd a comment|
I was trying to addJaVerslibrary to my current project. And I wondered Is there any ways to add to reference entity fields some field which will be shown instead of Id when I fetch changes? For example snapshot of User class:{ "owner": { "entity": "Owner", "cdoId": 1 }, "username": "TMP",... }and if I change Owner reference and fetch for changes, I will get:ReferenceChange{ 'owner' changed from 'Owner/1' to 'Owner/2' }What I want is some thing like:{ "owner": { "entity": "Owner", "cdoId": 1 "cdoName": "OWN" }, "username": "TMP",...and changes like this:ReferenceChange{ 'owner' changed from 'OWN' to 'FOO' }Is there any way to achieve this? I`m using Javers 3.11.3
JaVers - how to add extra fields to reference entity in JSON
Use a fiddler to take a look at the HTTP response - probably Response Header has:Cache-Control: no cache.If you using Web API 2 then:It`s probably a good idea to useStrathweb.CacheOutput.WebApi2instead. Then you code would be:public class ValuesController : ApiController { [CacheOutput(ClientTimeSpan = 3600, ServerTimeSpan = 3600)] public int Get(int id) { return new Random().Next(); } }else you can try to use custom attributepublic class CacheWebApiAttribute : ActionFilterAttribute { public int Duration { get; set; } public override void OnActionExecuted(HttpActionExecutedContext filterContext) { filterContext.Response.Headers.CacheControl = new CacheControlHeaderValue() { MaxAge = TimeSpan.FromMinutes(Duration), MustRevalidate = true, Private = true }; } }and thenpublic class ValuesController : ApiController { [CacheWebApi(Duration = 3600)] public int Get(int id) { return new Random().Next(); } }ShareFolloweditedSep 5, 2016 at 9:39answeredSep 5, 2016 at 9:34VladimirVladimir1,39022 gold badges1919 silver badges2323 bronze badges2I went with the custom attribute. Works very well. Thanx!–user256890Sep 6, 2016 at 13:47glad I could help )–VladimirSep 6, 2016 at 13:56Add a comment|
public class ValuesController : ApiController { [System.Web.Mvc.OutputCache(Duration = 3600)] public int Get(int id) { return new Random().Next(); } }Since caching is set for 1 hour, I would expect the web server keeps returning the same number for every request with the same input without executing the method again. But it is not so, the caching attribute has no effect. What do I do wrong?I use MVC5 and I conducted the tests from VS2015 and IIS Express.
Caching of ASP.NET MVC Web API results
If you simply want a universal file to block robots then you can use something like this. This is not specific to a domain.RewriteEngine on RewriteCond %{HTTP_USER_AGENT} ^.*(AltaVista|Googlebot|msnbot|Slurp).*$ [NC] RewriteRule .* - [F,L]Edit: If you're subdomains are accessible from the main root .htaccess file then you can use a method like this and any temp domain it should block access.RewriteEngine on RewriteCond %{HTTP_USER_AGENT} ^.*(AltaVista|Googlebot|msnbot|Slurp).*$ [NC] RewriteCond %{HTTP_HOST} ^([0-9]+)\.temp\.oursite\.com$ [NC] RewriteRule .* - [F,L]
Our company has temp development urls that are being indexed by search engines. We need to get this to stop via a global htaccess file. By global, i mean i want to drop this access into our root that will apply the rules for each site. Every time we build a new site, i don't want to drop a htaccess file in that folder.I am terrible at writing htaccess rules, otherwise i would have done it myself. I would appreciate any input from the community.Here is an example temp url: 1245.temp.oursite.comRewriteEngine on RewriteCond %{HTTP_USER_AGENT} AltaVista [OR] RewriteCond %{HTTP_USER_AGENT} Googlebot [OR] RewriteCond %{HTTP_USER_AGENT} msnbot [OR] RewriteCond %{HTTP_USER_AGENT} Slurp RewriteRule ^.*$ "http\:\/\/oursite\.com" [R=301,L]I've tried playing with this, but like i stated above, i'm terrible at writing htaccess rules.EditThe question is similar tothis one, however mine involves sub-domains.
Block crawlers from subdomain via htaccess
Not automtaically, but Docker does know which layers are not used in images, and you can remove those "dangling" image layers like this: docker rmi $(docker images -f "dangling=true" -q) While you're clearing up, you can also remove exited containers: docker rm $(docker ps -a -q) And dangling volumes: docker volume rm $(docker volume ls -qf dangling=true)
I have a script which I use to build docker images. The script starts up a docker container, executes some commands on it, and then does docker commit to fixturize the image. When I commit with an image name/tag, and then later commit with the same image name/tag, I would like the previous image to be removed, since at that point it's just taking up disk space. Instead it sticks around (I can see it in docker images, with its repository and tag both listed as <none>). Is there a way to have docker automatically remove these replaced images?
Remove existing image when using `docker commit`?
You can preload images which will cause them to be in the cache so they are available immediately for things like mouse events. Seethis postfor sample code that pre-caches an array of images.function preloadImages(srcs) { if (!preloadImages.cache) { preloadImages.cache = []; } var img; for (var i = 0; i < srcs.length; i++) { img = new Image(); img.src = srcs[i]; preloadImages.cache.push(img); } } // then to call it, you would use this var imageSrcs = ["src1", "src2", "src3", "src4"]; preloadImages(imageSrcs);
I have this webpage which shows me some images and some images are on a mouseover event and hence it takes time for them to display. I have worked it around by placing the mouseover image and hidding them through display none property which puts them in browsers cache and display them quickly on mouseover.I was thinking that is it possible to insert the images into cache of a browser by another way like using jQuery or something so i dont have to put images in hidden form.I dont know if this is a stupid question.Please comment.Regards Himanshu Sharma
Is it possible to insert images in cache before rendering
The rate function expect a range vector, for example:rate(NumberOfLogins[5m])That means to calcualte the rate within the last 5 minutes at each time point. You can change the5mto other time range.Therefore this would fit you need:rate(NumberOfLogins[5m]) / rate(NumberOfVisitors[5m])
I have two metrics, Counters to be precise, lets say they are calledNumberOfVisitorsNumberOfLoginsIn grafana I would like to plot is the number-of-logins divided by the number of visitors (or the other way around) over time. So I triedrate(NumberOfLogins) / rate(NumberOfVisitors)but this results in an errorError executing query: invalid parameter 'query': parse error at char 46: expected type range vector in call to function "rate", got instant vectorI'm not sure what all that means. Hopefully something like this is possible. Any help would be appreciated
How to divide two Prometheus Counters
The answer you're looking for issum by(job) (increase(web_latencies_summary_count[1m]))with aMin stepof1m.Unfortunately, due to the wayincrease()/rate()is computed by Prometheus, this will actually give you the number of requests over 45 seconds extrapolated to 1 minute (i.e.increase[45s] / 45 * 60). A more accurate formula would besum by(job) (increase(web_latencies_summary_count[75s])) / 75 * 60but do note that (a) this depends on your scrape interval; and (b) due to the timestamps not being exactly 15 seconds apart, the results will not be integers.
I have prometheus operator which scrapes a metric every 15 seconds:I would like to "zoom out a bit" and show a sum of my latencies per 1 minute instead. However, I can't find a query to do so. I tried various options withrate()andsum_over_time(), but queries simply error out.I also tried changing this option:to 1 m. What happened is 3 out of 4 15second intervals just got omitted. Instead of summing all my 15 second results in a minute.How could I achieve the desired result?
How to sum 15 second intervals within 1 minute window in prometheus?
Seems like you have misconfigured yourSettings Repository pluginand it pushes your IDE settings into the project's repository instead of its own.Similar case:https://devnet.jetbrains.com/message/5566999#5566999
I developed my app, then committed and pushed on GitHub (I'm a newbie in version control). Then due to an unrelated problem I had to manually add my GitHub repo into workplace using CLI.I set up a new project and pushed another change. It appeared OK, but when I checked up the repo, I saw many strange xml files in the root directory. I found out that these were myWebstorm settingslike interface settings, theme, github info etc ("personal data"), as they were committed withWS-11.0.3 <%my_username% Create file.template.settings.xml, phonegap.xml, IntelliLang.xml, ide.general.xml, web-browsers.xml, git.xml, keymap.xml, Default.xml, diff.xml, laf.xml, other.xml, debugger.xmlmessage (it is phonegap project).After update these files appeared in my local project root too (where they obviously shouldn't be). Deleting them and pushing empty commit throws an error, which is claiming that merging is needed. Moreover, deleting these files resets some of my WS settings (color scheme for example).I tried adding them and whole .idea/ in .gitignore, but that didn't help. Creating a new project from scratch doesn't work as WebStorm doesn't have feature to add remote repo manually. I have to checkout project files from the repo I work with, BUT a clean project with a new clean repo works fine)It looks like this
IDEA sends "personal data" when pushing on GitHub
As it turns out this was not a problem with security groups. It was just coincidental, that it worked at the time when I changed the security groups.It seems the containers aren't starting fast enough to accept connections from the alb when it starts the health checks.What helped:changinghealthCheckGracePeriodto two minutestweaking the healthcheck paremeters for the target group,interval,unhealthyThreshold,healthyThresholdAlso, in my application logs it looks like the service gets two health check requests at once. Per default theunhealthy thresholdis set to 2. So maybe the service was marked unhealthy only after one health check.
I have an ecs fargate cluster with an ALB to route the traffic to. The docker containers are listening on port 9000.My containers are accessible over the alb dns name via https. That works. But they keep getting stopped/deregistered from the target group and restarted only to be in unhealthy state immediately after they are registered in the target group.The ALB has only one listener on 443. The security groups are set up so that thesg-alballows outbound traffic on port 9000 tosg-fargateandsg-fargateallows all inbound traffic on port 9000 fromsg-alb.The target group is also setup to use port 9000.I'm not sure what the problem is, or how to debug it.Everything is set up with cdk. Not sure if that's relevant.
AWS Application Load Balancer health checks fail
The garbage collector can't be "too slow" and run out of memory. Before throwing an OutOfMemoryError, the garbage collector is guaranteed to run. Only if it cannot free enough memory will the error be thrown.You should use a profiler to see whether you have memory leaks, or if you're just hanging on to too many objects.Afterwards you may want to tune the GC to improve performance, see for example here:GC tuning
I've been playing around with caching objects (by first creating my own cache which turned out a stable implementation but very inefficient) and then trying my hand at using Memcached.Although memcached works beautifully, I've ran into a problem.How I'm using my objects is as follows:I read data from a database into an object, then store the object in memcached.Every couple of minutes I retrieve the object from memcached, retrieve any additional data from either the database or other objects in memcached, update the object with any new / relevant data, then store the object back into memcached.Objects that need to be viewed are pulled from memcached, packaged and sent onto a client-side application for display.This works very well, except when the number of objects I'm creating-storing-updating-viewing in memcached becomes high. Java/Tomcat-jvm doesn't seem to be garbage-collecting "fast enough" on the objects I pulled out of memcached, and the vm runs out of memory.I'm limited to 8GB of memory (and would preferably like to bring that down to 4 if I can - using memcached), so my question is, is there a solution in preventing the JVMs memory usage from expanding so fast (or tune the garbage collector)?(PS I have considered using Guava cache from Google, but this limits my options in concurrency e.g. if I have to restart tomcat, and using both Guava and memcached seems like a duplication of sorts which I'd like to avoid of possible)-- Hein.
Using memcached with Java and ScheduledFuture objects
Asexplained here, it can be due to the lack of knowledge from the cron session shell of the ssh agent.If that is the case (ie if you are using private ssh keys with a passphrase),keychainis the usual solution (asmentioned here).More details in this example: "Passwordless connections via OpenSSH using public key authentication, keychain and AgentForward".
I'm trying to run agit pushfrom cron. When I do the command interactively on the shell it's going through fine. When running the command from my user's crontab, cron delivers the error messagePermission denied (publickey).I presume it hasn't to do with finding or reading my ~/.ssh/id_rsa, as I can cat the file from cron alright. UID and EUID are set fine in the cron job. - Any ideas?UPDATEI got it working when supplying the environment key SSH_AUTH_SOCK to my cron job, but I'm concerned that this is only valid as long as I'm logged in. I'm looking for a solution that works independent of interactive logins.
Permission denied (publickey) when using crontab [duplicate]
These icons are done with the font - 'Octicons Regular', so that won't be loading for you for some reason. It is all done with CSS so shouldn't require js to work. See this page for details: https://github.com/styleguide/css/7.0 Perhaps try checking that you don't have remote font loading disabled (there is a command line switch I think), or a bad version of this font cached, or some other font issue - you can check what has loaded if you enable the inspector and look in resources for that frame, there should be a Fonts listing with the Octicons font listed. You could also try downloading the font and installing locally. If you cannot load other fonts, probably it's a setting rather than this specific font. You might be able to see the font loading settings here: chrome://about I think the setting you need is --enable-remote-fonts which you can run from the command line to turn them on again (on by default now).
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 years ago. Improve this question Is anybody else's GitHub missing icons? There are no JS errors, and from what I can tell looking at resources in Chrome developer tools, no 404 errors.
GitHub icons missing [closed]
When you forked the project, github created a copy of repository under your account. You should be able to pull it using git clone [email protected]:[your user name]/[repository name].git Then when you make your changes, you'd commit them and push the updates to github: git push origin master Once you did that, repeat cloning of the repository on your second machine which will then have the up-to-date version of the repository.
This is a noob question, but I forked a project and made few edits to it. So now I wish to do the following, Step 1: Update the forked project with my changes from Machine 1. is it possible to update forked project and keep the original (master) untouched? Step 2: pull the updated fork to machine 2. Also when I forked the project, I forked it using the online portal and manually downloaded the tarball. So can I update the forked project?? Both Machine 1 and machine 2 have there SSH keys in the GitHUB
update GitHUB forked project not the master
1 Have you tried increasing the allocated memory, e.g. running node with --max-old-space-size=4096? Share Improve this answer Follow answered Aug 16, 2016 at 16:12 Kiara GrouwstraKiara Grouwstra 5,81344 gold badges2222 silver badges3737 bronze badges 1 my ec2 was crashing about half of the time i ran meteor. i think its doing better after running: export TOOL_NODE_FLAGS="--max-old-space-size=4096" – Yehuda Clinton Nov 9, 2017 at 14:47 Add a comment  | 
I'm currently running a basic website on an amazon EC2 t1.micro instance. The application is built using meteor js. After a while I get the following error in the errors log file and the server crashes: FATAL ERROR: Committing semi space failed. Allocation failed - process out of memory Could somebody help me with this issue? Have I misconfigured something?
committing semispace failed. allocation failed - process out of memory in meteor js ec2 instance
Thekubectl auth can-icommand makes the following API request:POST /apis/authorization.k8s.io/v1/selfsubjectaccessreviewsWith aSelfSubjectAccessReviewobject as a body parameter namedbody.You can see this by executing the kubectl command with increased verbosity, for example:kubectl auth can-i create pods -v 6And you can find the documentation of the API endpoint in theAPI reference.
kubectlhas theauth can-isubcommand. Which K8s API does the command use? I triedauthorization.k8s.io/v1SelfSubjectAccessReviewbut it requires the extra permissions to perform the request. Does anybody know how it works in thekubectl?
What is Kubernetes API analog for `kubectl auth can-i`
Depends on how automatic you want it to be. A simple approach would be an initContainer to provision a new token, put that in a shared volume file, and then an entrypoint script in the main container which reads the file and sets the env var.The problem with that is authenticating the initContainer is hard. The big hammer solution would be to write a custom operator to manage this but if you're new to Kubernetes that's going to be super hard and probably overkill anyway.
I am fairly new to kubernetes and learning kubernetes deployments from scratch. For a microservice based projecct that I am working on, each microservice has to authenticate with their own client-id and client-secret to the auth server, before requesting any information (JWT). These ids and secrets are required for each services and needs to be in their environment variables. Initially the auth service will generate those ids and secrets via database seeds. What is the best way in the world of kubernetes to automatically set this values in the environments of a pod deployment before pod creation?
Dynamic token generation before deployment in kubernetes
It looks like an incorrect setting of vm.vfs_cache_pressure = 1000 was causing this misbehaviour. Setting it to 70 fixed the problem and restored good cache performance. And the documentation explicitly recommends against increasing the value beyond 100. Unfortunately, the Internet is full of examples with insane values like 1000.
When linking executables (more than 200) in a large project, I get link rate 0.5 executables per second, even if I have ran the link stage a minute before. vmstat shows more than 20MB/s disk read rate. But if I pre-cache the build directory using "tar cf /dev/null build-dir" once, I get consistent link rate of 4.8 executables per second and the disk read rate is basically zero. Why doesn't Linux cache the object files and/or ".so" files when they are read by GNU Linker, but does so when they are read by tar? There is plenty of RAM (16GB). Kernel version is 4.4.146. CentOS 7.5.
Why doesn't Linux cache object and/or ".so" files when using GNU Linker?
The problem is that you forgot to git commit your changes before switching to the master branch. Git doesn't know to where the changes belong, so it just assumes the changes are for the branch you currently are in.If you specify a branch to where these changes should be documented, the merge would be possible.
I created a new branch and removed one file from my local repository. Then checkedin to my master to merge my branch. But during the checkout itself the repository is updated and when try to merge my branch its says 'Already up-to-date' C:\git\junit [cleanup +0 ~0 -1]> git rm '*.md' rm 'README.md' C:\git\junit [cleanup +0 ~0 -2]> git checkout master D README.md D target/surefire-reports/com.tester.webdriver.MyFristTest.txt Switched to branch 'master' **Your branch is up-to-date with 'origin/master'.** C:\git\junit [master +0 ~0 -2]> git merge cleanup Already up-to-date.
GIT checkout to master from branch itself updated my local repository
While it is true that low occupancy SMs cannot sufficiently hide latency, it is important to understand this: Higher Occupancy != Higher Throughput! Occupancy is simply a measure of how much work is available for the SM to choose from at any given instant. Having more resident warps gives the SM more ability to do useful work while other warps are waiting for results (results of memory accesses, or computations -- both have non-zero latency). Throughput is a measure of how much work gets done per second, and while it can be limited by latency (and therefore occupancy), it also can be limited by memory bandwidth, instruction throughput (the number of execution units), and other factors. The reason the programming guide states that it is better to have multiple thread blocks than just one large thread block is because sometimes it is better to be able to issue work from not just other warps but also other blocks. Here's an example: Imagine that your big thread block has to load data from global memory (high latency) and store it in to shared memory (low latency), and then must immediately do a __syncthreads(). In this case, when a warp is finished loading its data and writing it to shared memory, it must then wait until all other threads in the block finish doing the same. For a large block, that can be quite a while. But if there are multiple smaller thread blocks occupying the SM, then the SM could switch and do work from the other blocks while waiting for the __syncthreads to be satisfied in the first block. This can help reduce GPU idle time and improve efficiency. You don't necessarily want to have really tiny blocks (since the SMs on Fermi support at most 8 resident blocks), but having blocks of 128-512 threads is often more efficient than using blocks with 1024 threads.
I have a question about the throughput of a kernel running on a GPU. Assuming its occupancy is 0.5, block size is 256: the programming guide states that it is better to have many blocks so they can hide the memory latency, etc. But I don't understand why this is correct. Because as soon as the kernel has a number of warp per Streaming Multi-processor = 24, i.e., 3 blocks, it will reach the peak throughput. So having more than 24 warps (or 3 blocks) won't change anything to the throughput. Am I missing anything? Can anyone correct me?
The peak throughput of cuda Kernel on NVIDA GPU
1 If it's not showing updates when you pull, that's probably because you forked the project. The origin you've been pushing and pulling from is the one for your forked version. If you print out .git/config, for your local repository, you can see if this is the case. Just run cat .git/config in the root of the repository. In order to get updates from the project, add their git repo as an upstream: git remote add upstream <git url to their project> Then, fetch changes from that upstream: git fetch upstream You can see what changes they've made via git diff: git diff master upstream/master Question: How did you contribute your changes to the project? If you pushed, then it's likely you just pushed to your forked version, not the project yourself. If you created a pull request that got accepted, then the changes got merged in. Does their project have your changes? This determines how to proceed. Share Follow answered Nov 11, 2021 at 17:27 Alecto Irene PerezAlecto Irene Perez 10.5k2525 silver badges4747 bronze badges Add a comment  | 
I have contributed to a Open Source Project in GitHub. There are only one branch master and in my Local there is also one branch named master. I have contributed about 3-4 times. When I write git pull it show me Already Up to Date. Now the problem is in Open Source there are some changes but I can't get update with them. Like they have 762 lines of code in README.md but I have only 722 lines of code. I have tried, git pull git fetch git reset --hard origin/master git fetch --all git reset --hard HEAD git stash git pull git fetch origin git status Help to me solve this with safe way without loose any data from local.
How to get latest code of Open Source Project where I have contributed
https://prometheus.io/docs/prometheus/latest/querying/functions/#label_replacelabel_replace(database_bootstrapping{instance="host1",job="db"}!=0 or absent(database_bootstrapping{instance="host1",job="db"}), "__name", "database_bootstrapping")
I am doing a union operation on two datapoints.database_bootstrapping{instance="host1",job="db"}!=0. no data absent(database_bootstrapping{instance="host1",job="db"}).Query isdatabase_bootstrapping{instance="host1",job="db"}!=0 or absent(database_bootstrapping{instance="host1",job="db"})Result is{instance="host1",job="db"}. 1What I want isdatabase_bootstrapping{instance="host1",job="db"} 1How can I retain the ____metric____ label name in the query output?
PromQL Union operator omitting __metric__ label
1 The problem is that an FTP client opens two random ports—one for control, and one for the actual data. Because of the way that Docker networks work, you cannot dynamically map those ports. The non-secure way to resolve this is to add a flag on the run command which eliminates the network isolation of the container. docker run [other flags] --network host <image_name> Technically, this changes the network driver that the container uses. More info on this can be found in Docker's Networking using the host network tutorial. Edit: Option was spelled with a single colon instead of two. Share Follow edited Nov 3, 2020 at 12:56 JohnZoidberg 9722 silver badges88 bronze badges answered Jun 17, 2020 at 19:36 JackzafJackzaf 1122 bronze badges Add a comment  | 
Seemed like a fairly straightforward thing to do , I want to use an FTP client to copy files to and from a local docker container on a windows machine. I am using a bitnami container ( Magento 2 , but please don't tag this post as magento as it's more of a docker question ) , and I prefer using a GUI Ftp client like Filezilla as opposed to using the command line. How can I set this up? Or maybe I am missing something in regard to docker. Thank you!
How to use FTP Client with Docker containers
It's complicated and discussed herehttps://aws.amazon.com/premiumsupport/knowledge-center/ec2-sudoers-syntax-errors-sudo/Basically you detach the EBS volume from the EC2, mount it on another EC2, use root privs on that host to fix the file and then reattach it to the EC2
I am working on AWS EC2 machine. File permission of sudores file is,-rwxrwxrwx 1 root root 902 Feb 5 12:22 sudoersThere are various question on this , but these not works. When i am trying to do,sudo chmod 444 sudoersThis show error,sudo: /etc/sudoers is world writable sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy pluginHow to fix it ?
How to fix this sudo: /etc/sudoers is world writable?
If you want to set a header for your response you can do this: namespace App\Http\Middleware; use Closure; class AlwaysReturnJson { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $response = $next($request); $response->headers->set('Content-Type', 'application/json'); return $response; } } If you want to force return valid json content use this middleware instead: namespace App\Http\Middleware; use Closure; class AlwaysReturnJson { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $response = $next($request); return response()->json($response->getContent()); } } See Laravel docs about after middleware for more info. You can alternatively return json response on your controller without any middleware needed: Route::get('/', function () { return response()->json( view('welcome')->render() ); });
I have a route in my web.php that returns a view: Route::get('/', function () { return view('welcome'); }); welcome is default Laravel view welcome.blade.php. I have Middleware called AlwaysReturnJson and it contains: <?php namespace App\Http\Middleware; use Closure; class AlwaysReturnJson { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public function handle($request, Closure $next) { $request->headers->set('Accept', 'application/json'); return $next($request); } } I set up this middleware in Kernel.php as global middleware: protected $middleware = [ \App\Http\Middleware\AlwaysReturnJson::class ]; What I expect is to get plain text/json of welcome file in my browser when I navigate to given route but I always get it as html and it render page properly. I checked it, it applies middleware on every request so that is not a problem. Why is this happening and shouldn't it convert that view to a plain text? Am I doing something wrong?
Return every request as plain json Laravel using Middleware
19 If you have checked "Lambda Proxy Integration" in your Method Integration Request on API Gateway, you should receive the stage from API Gateway, as well as any stageVariable you have configured. Here's an example of an event object from a Lambda function invoked by API Gateway configured with "Lambda Proxy Integration": { "resource": "/resourceName", "path": "/resourceName", "httpMethod": "POST", "headers": { "header1": "value1", "header2": "value2" }, "queryStringParameters": null, "pathParameters": null, "stageVariables": null, "requestContext": { "accountId": "123", "resourceId": "abc", "stage": "dev", "requestId": "456", "identity": { "cognitoIdentityPoolId": null, "accountId": null, "cognitoIdentityId": null, "caller": null, "apiKey": null, "sourceIp": "1.1.1.1", "accessKey": null, "cognitoAuthenticationType": null, "cognitoAuthenticationProvider": null, "userArn": null, "userAgent": "agent", "user": null }, "resourcePath": "/resourceName", "httpMethod": "POST", "apiId": "abc123" }, "body": "body here", "isBase64Encoded": false } Share Follow edited Nov 22, 2016 at 23:34 answered Nov 22, 2016 at 22:37 JS1010111JS1010111 39922 silver badges1212 bronze badges 1 2 How do you access that within Lambda (java) – DevilCode Jan 29, 2017 at 1:40 Add a comment  | 
I have the following Lambda function configured in AWS Lambda : var AWS = require('aws-sdk'); var DOC = require('dynamodb-doc'); var dynamo = new DOC.DynamoDB(); exports.handler = function(event, context) { var item = { id: 123, foo: "bar"}; var cb = function(err, data) { if(err) { console.log(err); context.fail('unable to update hit at this time' + err); } else { console.log(data); context.done(null, data); } }; // This doesn't work. How do I get current stage ? tableName = 'my_dynamo_table_' + stage; dynamo.putItem({TableName:tableName, Item:item}, cb); }; Everything works as expected (I insert an item in DynamoDB every time I call it). I would like the dynamo table name to depend on the stage in which the lambda is deployed. My table would be: my_dynamo_table_staging for stage staging my_dynamo_table_prod for stage prod However, how do I get the name of the current stage inside the lambda ? Edit: My Lambda is invoked by HTTP via an endpoint defined with API Gateway
How to get the name of the stage in an AWS Lambda function linked to API Gateway
It leaks in Objective-C because Objective-C doesn’t take any action on it. It relies on you doing all the work. It doesn’t leak in C# (more precisely, in .NET) because it employs a garbage collector which cleans up objects that are no longer used. The main advantage of garbage collection is the above: you have far fewer memory leaks. (It’s still possible to have a memory leak, e.g. by filling a list indefinitely, but that’s harder to do accidentally.) It used to be thought that garbage collection has a disadvantage in that it could slow down the program because it keeps doing the garbage collection in the background and you have little control over it. In reality, however, the difference is negligible: there are other background tasks on your computer (e.g. device drivers) running all the time, the garbage collector doesn’t break the camel’s back either. Auto-deallocation (as it is employed in C++ when a non-pointer variable goes out of scope) is dangerous because it opens the possibility to have a reference to it still in existence even after the object has been disposed. If your code then tries to access the object, the process goes kaboom big time. Yes, it is possible to tell C# to release memory by invoking the garbage collector directly (GC.Collect()). However, I have yet to see a case where this is at all necessary. If you actually run out of memory, the garbage collector will already kick in automatically and free as much as it can.
SO I already know about memory management in objective C, and I never had to know about it while programming in .net (C#). But i still have some questions about how everything is done. -Why does the code leak in objective c if we allocate an object and not release it? -Why doesn't this leak in C#? -What are some advantages and disadvantages of automatic-garbage-collecting? -Why not use autorelease on every allocated object (Objective C)? -Is it possible to take care of the memory manually (C#)? so let's say i instantiate an object, and when I'm done i want to release it, and i don't want to wait for the garbage collector to do it?
Memory management - C# VS Objective C?
3 If your application ignores the X-Forwarded headers for setting the scheme in http 3xx responses, you could try setting one or more proxy_redirect rules: proxy_redirect http:// $scheme://; See this document for details. Share Improve this answer Follow answered Feb 2, 2016 at 9:20 Richard SmithRichard Smith 47.6k66 gold badges8888 silver badges8585 bronze badges Add a comment  | 
I am having some troubles with my application. During redirects my flask application lose the https and redirect to http instead. I've been trying to find the solution but nothing works. My nginx configuration for the application (location /) is as follows: proxy_pass http://localhost:5400; proxy_set_header Host $host; proxy_set_header X-Forwarded-port 443; proxy_set_header X-Scheme $scheme; proxy_set_header X-Forwarded-Protocol $scheme; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; (Some examples on the internet says to use "X-Forwarded-Proto". I've tried that without success. And also to use "ssl" or "https" as value on that parameters. A simple print in the flask application (before_request:) shows that it is still http-requests made event though i use https between client and nginx. print(request.environ["wsgi.url_scheme"]) What am I doing wrong?
Nginx, gunicorn, python-flask application. Https is lost on redirect
2 If you wish to use Python 3, you're going to have to use the Python 3 docker image, in your case it would be: FROM tensorflow/tensorflow:latest-gpu-py3 You can see all the py3 tags here. There's also an issue about this, but the tl;dr is that the image size is too big if it were to support both Python 2 and 3, hence separate py3 tags. Share Improve this answer Follow answered Jun 14, 2018 at 16:33 ShouShou 1,9791717 silver badges2929 bronze badges Add a comment  | 
I have a very basic dockerfile as follows: FROM gcr.io/tensorflow/tensorflow:latest-gpu FROM python:3.5 RUN pip install opencv-python RUN apt-get update && apt-get install -y libsm6 libxext6 libxrender-dev RUN pip install skll RUN pip install keras RUN pip install imutils ADD . /model1 WORKDIR /model1 VOLUME ["/model1/data", "/model1/notebooks"] I have been learning docker for a day so I accept that this probably breaks best practices. My question is this - once I build this and run the container and then open python and run import tensorflow I get ImportError: No module named 'tensorflow' If I don't include python 3.5, when I open up python its version 2.7 and tensorflow is imported properly. How can I import tensorflow using python 3 and specify this in the dockerfile
Docker: can't import tensorflow in python3 but can in python2 following dockerfile build
Problem was fixed with SDK Tools revision 19http://code.google.com/p/android/issues/detail?id=28529
I have downloaded the entire Android SDK from the official website and I installed a new emulator (Android 4.0.3). As long as I don't have GPU emulation enabled it works (even if it need about 5 minutes to start and then uses a lot of resources) but when I enabled it the emulator enters a loop or something and it never loads. When I look at the Task Manager I see the memory usage growing up until a Windows message displays a warning about the low memory that's left (so, I have to close it).When I execute"adb logcat"I get this repeating error:E/EGL/Emulation < 113>: RcMakeCurrent returned EGL_FALSE E/EGL/Emulation < 113>: tid 114: egMakeCurrent<976>: error 0x3006 <EGL_BAD_CONTEXT> E/libEGL < 113>: egMakeCurrent:674 error 3006 <EGL_BAD_CONTEXT> E/SurfaceFlinger< 113>: Couldn't create a working GLES context. checks logs. exiting...My computer's graphic card is a nVidia 8400 GS 512 Mb, my processor is a 3,2 Ghz Intel, it doesn't support hardware virtualization, I can run WebGL. Maybe this information may be of use for the detection of the problem.Thanks for your help
Android emulator infinite loading and errors when GPU emulation is enabled
3 According to official documentation, and the steps I followed to install docker in Ubuntu 22.04 LTS Visit the following site https://docs.docker.com/engine/install/ubuntu/ Scroll down until you find the Install using the convenience script section. You will find the following commands: $ curl -fsSL https://get.docker.com -o get-docker.sh $ DRY_RUN=1 sh ./get-docker.sh the first command will install a shell script with the all needed commands and the other will run this shell script. You can test the installation by running these commands $ sudo docker --version $ sudo docker info If it looks fine, you now have docker in your machine. Optional step is to download docker desktop for Ubuntu 22.04 https://docs.docker.com/desktop/linux/install/ MAKE SURE You already installed docker engine before installing docker desktop for Ubuntu Share Follow edited May 30, 2022 at 11:49 answered May 29, 2022 at 12:25 Yahya Ashraf AfifiYahya Ashraf Afifi 3144 bronze badges 1 This saved me, because installing the docker desktop .deb just resulted in an unhelpful "Dependency resolution failed" which I didn't find anything about. So I hope Google will index this and help the next lost soul. – Cilvic Sep 28, 2023 at 18:03 Add a comment  | 
I am following the docker installation tutorial in ubuntu: https://docs.docker.com/desktop/linux/install/ubuntu/ And when I try this step: sudo apt install ./docker-desktop-4.8.1-amd64.deb I am getting the next error: E: Unsupported file ./docker-desktop-4.8.1-amd64.deb given on commandline Not sure what that means or if I am missing something. E: Unsupported file ./docker-desktop-4.8.1-amd64.deb given on commandline I also tried with: curl https://desktop-stage.docker.com/linux/main/amd64/74134/docker-desktop.deb --output docker-desktop.deb sudo apt install ./docker-desktop.deb And got the error: E: Invalid archive signature E: Internal error, could not locate member control.tar{.zst,.lz4,.gz,.xz,.bz2,.lzma,} E: Could not read meta data from /home/rodolfo/docker-desktop.deb E: The package lists or status file could not be parsed or opened. Any ideas?
How to install docker correctly in ubuntu 22.04 is it possible at this time?
Try git reset --hard to throw out the changes (including conflicts) in the working directory and reset your branch to its pre-merge-attempt state. From the branch you want to merge into, use git merge <other branch>. If there are conflicts, resolve them by opening the files and merging the lines between the <<<<< and >>>>> conflict markers, then git add <merged file>. When you have manually resolved all the conflicts, git commit to finish the merge.
I am experimenting with branching on git and running into nightmare after nightmare. Anyway, the current issue is that I wanted to merge the master into the branch. I tried "git rebase" because some site recommended that, and it did a number of destructive things but definitely did NOT merge my trunk into the branch. It actually blew up everything quite horribly and created all kinds of complicated merge errors and I cannot figure out how to simply revert my code to where it was before. My question is twofold: 1) How do I make git completely revert to the point just before the git rebase? Everything I try gives me all kinds of headaches about merge errors. I don't want to merge anything. I just want to take a specific revision exactly as it was and make that the HEAD. 2) Once I get the mess cleaned up, how do I merge a trunk into a branch? For what it's worth, the merge should not be all that complicated in terms of conflicts.
simple checkout in git?
Kindly remove helm using helm uninstall from default namespace and then install again in specified namespace by using -n (namespace) e.g helm install grafana grafana/grafana -n monitoringthis will work
I have installed prometheus in namespace monitoring and grafana in default namespace. can i copy or move any of this in either default namespace or monitoring namespace. What can be the possible issues i can face going forward ?I tried this : helm install grafana grafana/grafana (installed in default namespace)i want to move this to namespace monitoring so i tried this : helm install grafana grafana/grafana --namespace monitoringbut get this error : Error: INSTALLATION FAILED: rendered manifests contain a resource that already exists. Unable to continue with install: ClusterRole "grafana-clusterrole" in namespace "" exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key "meta.helm.sh/release-namespace" must equal "monitoring": current value is "default"
kubernete cluster running on kind , setting up prometheus and grafana for monitoring
I ran into this issue today. Turns out that I had miss configured SonarQube.Analysis.xml. Essentially, it expects<Property Name="sonar.host.url">http://{server}:9000/sonar</Property>including/sonar(which comes from sonar.web.context setting of sonar.properties on the server).I had missed out /sonar in SonarQube.Analysis.xml and had exact same symptom as yours.
Unable to execute sonar run for ms build when i change the sonar host from localhost to my machine ip.tried changing the host in sonar.properties file and also in sonarqube_analysis.xml.c:\HID\project-test\PACS\sonar_opencover\Project>MSBuild.SonarQube.Runner.exe end Default properties file was found at C:\HID\project-test\dotnet\MSBuild.SonarQube.Runner-1.0.1\SonarQube.Analysis.xml Loading analysis properties from C:\HID\project-test\dotnet\MSBuild.SonarQube.Runner-1.0.1\SonarQube.Analysis.xml Post-processing started. Execution failed. The specified executable does not exist: c:\HID\project-test\PACS\sonar_opencover\Project\.sonarqube\bin\MSBuild.SonarQube.Internal.PostProcess.exe Post-processing failed. Exit code: 1Scripts i executed@call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VsDevCmd.bat" MSBuild.SonarQube.Runner.exe begin /k:"jenkins_test5" /n:"jenkins_test5" /v:"1.0" /d:sonar.cs.opencover.reportsPaths="%CD%\opencover.xml" msbuild.exe "C:\HID\project-test\PACS\sonar_opencover\opencover.4.6.210\OpenCover.Console.exe" -output:"%CD%\opencover.xml" -register:user -target:"vstest.console.exe" -targetargs:"UnitTestProject1\bin\Debug\UnitTestProject1.dll" MSBuild.SonarQube.Runner.exe end
Doesnt find MSBuild.SonarQube.Internal.PostProcess.exe
Kubernetes allocates a single IP per pod, so no matter how many sidecars you have, a single pod will only have a single IP. Basically, you dont need to do anything in this regardShareFollowansweredSep 11, 2020 at 4:084c74356b414c74356b4170.4k66 gold badges104104 silver badges145145 bronze badgesAdd a comment|
Our Azure kubernetes cluster is configured with Azure CNI for networking which uses the subnet with CIDR: /21.As we are planning to deploy Istio service mesh and additional sidecars for log shipping, how would those impact the available IPs? Would those consume the IPs? If so, how to avoid the IP congestion?
Azure kubernetes - Azure CNI & Istio, sidecar IP allocation?
It appears that the repository is set up like this, with five commits and four branches:Every pull request has a source branch and a target branch:The first pull request is from branchYto branchX, which means commitssha1andsha2.The second pull request is from branchBto branchA, which means commitssha3,sha4, andsha1.It's not normal to have pull requests overlap like this. One or both pull requests ought to be edited to disentangle them from each other. Nevertheless, this appears to be the situation.ShareFolloweditedJan 12, 2022 at 0:58answeredJan 12, 2022 at 0:39John KugelmanJohn Kugelman355k6969 gold badges540540 silver badges582582 bronze badges1I validated your answer by checking the branch, your answer is correct, thank you–whoiswhoJan 12, 2022 at 0:46Add a comment|
I have been doing some mining work, I noticed that sometimes different pull requests may have the same commit (based on the sha, I could tell they are same). I am just wondering what would be the reason behind it?Example:Pull request 1 has two commits: sha1, sha2Pull request 2 has three commits: sha3, sha4, sha1Why does sha1 exist in both pull requests?
Why would a commit be listed in two different pull requests?
or should I maybe create the virtual environment first, and then clone the repo into that instead?You don't want to put things into the virtual environment directory; this should be managed exclusively by Python's package management tools.It seems to me that if I create the venv folder inside of the repo, I'll have to be very careful not to accidentally include it in one of my commits.You don't need to be careful. You just need to add your venv directory to your.gitignorefile. For example, if I have a virtual environment in a.venvdirectory in my project, and I add that to my.gitignorefile:$ echo .venv/ >> .gitignore $ git add .gitignore $ git commit -m 'Ignore .venv file'Then even if I try to add the directory explicitly it won't work:$ git add .venv The following paths are ignored by one of your .gitignore files: .venv hint: Use -f if you really want to add them. hint: Turn this message off by running hint: "git config advice.addIgnoredFile false"I'm not sure I can exclude files from a pull request after I've pushed them.You can always update a pull request before it merges by pushing additional commits (or force pushing to replace existing commits). Look for articles about usinggit rebase.
I've been using Github to host my own repos for a while, and I'm familiar with pushing changes to my own repos, but I've never worked on someone else's project. I'd like to try that now. I'd like to help someone with a Sphinx / reST documentation project.The tutorial I'm following recommends creating a repo on Github, cloning the repo to my local computer, then creating a Python virtual environment inside of the cloned repo. However, the tutorial assumes the repo I'm working on is my own. In my case, it's not. I've forked the repo from someone else's account, and I'll have to make a pull request if I want to share my contributions.Is creating the Python virtual environment inside of the forked, cloned repo really the right way to do this, or should I maybe create the virtual environment first, and then clone the repo into that instead?It seems to me that if I create the venv folder inside of the repo, I'll have to be very careful not to accidentally include it in one of my commits. I'm not sure I can exclude files from a pull request after I've pushed them.
Create Python virtual environment in forked, cloned repo, or clone repo into virtual environment?
0 Untar archive to some REPOS_PATH Check the repo with svnadmin verify REPOS_PATH (and fix it in case of problems with svnadmin recover REPOS_PATH) OPTIONAL: Upgrade the repository located at REPOS_PATH to the latest supported schema version (2009 is rather old) svnadmin upgrade REPOS_PATH After it you have to have live SVN-repository, which can be accessed by file:/// protocol (for git-svn or SubGit) Share Follow answered Nov 25, 2015 at 14:44 Lazy BadgerLazy Badger 95.8k99 gold badges7979 silver badges110110 bronze badges Add a comment  | 
Sometime back, i took a tarred backup of full svn server directory. Because at that time, in 2009, i couldn't find a good way to take a real backup. The svn commands don't work on this as the repository url is not available on this machine. svn log svn: E200015: Unable to connect to a repository at URL 'http://192.168.1.1/svn' On searching, i could only find solutions for migration from a currently live svn repo to git, which i dont have. My goal is to get a git repo out of this svn repo backup and i guess, I need to have a working svn repo as a first step. Any way to achieve this?
How to re-create a svn repo out of a tarred backup on another machine
1 At first glance I'd say allocating 10M of continuous memory is already very suspicious. Why do you need that much? You're on Android, so that indicates an embedded platform, making 10M of memory even more suspicious. From the documentation I've found on-line you also need to specify how much cma memory the system needs at boot time. Did you specify more than 10M? Share Improve this answer Follow answered May 9, 2012 at 6:44 Kristof ProvostKristof Provost 26.1k22 gold badges2626 silver badges2828 bronze badges 1 As I mentioned that the application is camera app. One click takes a frame of around 6-7MB. This requires a big chunk of memory. Yes I was allocating 12M memory. When I increased the value to 30M in defconfig file, it started working. Not sure about the reason how it worked but 12M is still greater than what I required(10M). – 0x07FC May 10, 2012 at 16:32 Add a comment  | 
I am working on Camera Driver and whenever I try to allocate the memory around 10M, it fails but 4-5M memory is created. Is there a limit to memory allocation using cma_alloc? If yes, how do I increase it?
cma_alloc fails to create memory chunk of 10M
Looks like your rabbitmq node is... down.rabbitmqctlneeds a running node to perform these commands.If you're using systemd, you can check the service status:service rabbitmq-server statusOr just try to restart the node:rabbitmqctl start_appTelnet on port 25672 tells you the rabbitmqctl is running, but RabbitMQ itself does not run on that port (by default, it's listening on 5672).
I am getting node down error on rabbitmq, this is happening sometimes.Able to see the below error when I execute:sudo rabbitmqctl statusorsudo rabbitmqctl list_queuesError: unable to connect to node : nodedown connected to epmd (port 4369) on host-name epmd reports node 'rabbit' running on port 25672 can't establish TCP connection, reason: timeout suggestion: blocked by firewall?version: {rabbit,"RabbitMQ","3.6.9"}os: Ubuntu 16.04I have checked hostname which is ok with me, not changed since the installationAlso able to telnet localhost 25672What could be the reason behind this error and possible solution?And one more question, I am checking node status using below APIcurl -s GET http://edx:[email protected]:15672/api/healthchecks/node/Is above API ok or not to check the health status of the node? Please suggest if there is anything else. I have set up one shell script which will call this API and if status is not ok then it will restart rabbitmq-server service. Script is executed from cron every minute.
Rabbitmq: Node down
It is best at first to generate ssh keys without a passphrase.Or you would have to deal with ssh-agent, as described in "Adding your SSH key to the ssh-agent"ssh-keygen -t rsa -C "key for xxx access" -q -P ""Publish your public key to your GitLab account, and it should not ask for a passphrase (provided you are using a[email protected]:<username>/<reponame>sshurl, not an https one)
I'm relatively new to git/gitlab. For my school gitlab account, I was trying to setupgit pushto not continuously ask for my rsa passphrase by using:export GIT_ASKPASS="<password goes here>"It did not work, and now I'm stuck trying to push to gitlab with a refused connection. Is there an easy way out? Or do I have to setup my rsa keys all over again? Thanks in advance for helping a noob in distress.
Undo: export GIT_ASKPASS="<password goes here>"
Sax parsing method doesn't load things in memory itself (as opposed to DOM). Only your way of handling events generated by SAX can cause memory overload. If you allow your users to chose freely an XML source, you have to either: build a parsing algorithm which stores in BD or file the result of the parsing one element at a time build a parsing algorithm which loads the first X elements of the XML source and if possible allows to fetch following elements when requested (paginate) check the length of the XML source before parsing in order to display an error message to the user asking him to load a smaller source Another reason for this OutOfMemoryError could be a memory leak in your application which is not related to your XML parser. For example, orientation changes, if not handled carefully, can easily cause memory leaks. If your application memory is saturated, the OutOfMemoryError can be triggered by ANY memory allocation, but this single memory allocation may not be responsible for the whole process memory saturation.
java.lang.OutOfMemoryError at com.solvoterra.xmlengine.Element.<init>(Element.java:9) at com.solvoterra.xmlengine.XML_Handler_Main.startElement(XML_Handler_Main.java:71) at org.apache.harmony.xml.ExpatParser.startElement(ExpatParser.java:146) at org.apache.harmony.xml.ExpatParser.append(Native Method) at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:505) at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:492) at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:308) at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:264) at com.solvoterra.xmlengine.Project_Man.readXML_File(Project_Man.java:148) at com.solvoterra.xmlengine.Project_Man.run(Project_Man.java:83) at java.lang.Thread.run(Thread.java:1102) I can see from this the error has occurred whilst running a new process which only contains the function to SAX Parse an XML file into memory (RAM) I don't know all the details as this information has been provided by an anonymous user on the market. Before the function to Parse is called all buffers and memory is cleared of existing data. Q: Is it possible that the user is trying to Parse a HUGE XML database into memory and the RAM allocated by his phone simply isn't enough to handle his database?
OutOfMemoryError
Git is different from SVN in that Git is a DVCS - Distributed Version Control System. That means every "working copy" is a full blown repo. Repos can talk to themselves and there is no need for a main repository ( but usually there is a main or "blessed" repo that is the central.) So when you created a Git "working copy", you created a repo. You setup another repo on different maching / server and push to it if needed. I don't know what you mean by "backup", but the metadate for git will be under the .git folder ( it will be hidden unless you have selected to show hidden files and folders in Explorer) Another feature of DVCS that results from having full blown repos and no main repos is that it works offline. You get full history and you can commit without contacting any server etc. Again, I don't understand why you would ask about security in this context? If it is offline, wouldn't that be the most secure? And Git has lots of security and integrity mechanisms.
I was using "Tortoisesvn" to take control of my programs's source code. But sometimes, I had problems/bugs while using it. So I decided to use "git"( http://code.google.com/p/msysgit/ ) Also, I'm using git with "Git Source Control Provider" visual studio plugin. Source control is very easy with this extension. So now I have few noob questions... 1) Where is the main repository? Where is the folder that my project's files backup? 2) Is this program working completely offline? I mean how secure is that? Are there any changes that someone can steal your files( repository/source codes etc. ) ? Thanks for any input* Best Regards,
Starter Questions for Using Git Windows Version with Git Source Control Provider
This depends on what your frontend and backend apps expect in terms of paths. Normally the frontend willneed to be able to find the backend on a certain external pathand in your case it sounds like your backend needs to be made available on a different path externally (/api) from what it works on within the cluster (/). You can rewrite the target for requests to the api so that/apiwill go to/when the request is routed to the backend:apiVersion: extensions/v1beta1 kind: Ingress metadata: name: dev-ingress-backend annotations: kubernetes.io/tls-acme: "true" nginx.ingress.kubernetes.io/rewrite-target: / spec: tls: - hosts: - demo.com secretName: tls-secret rules: - host: demo.com http: paths: - path: /api backend: serviceName: api-app servicePort: 8080And you can also define a separate ingress (with a different name) for the frontend that does not rewrite the target, so that a request to/webwill go to/webfor it:apiVersion: extensions/v1beta1 kind: Ingress metadata: name: dev-ingress-frontend annotations: kubernetes.io/tls-acme: "true" spec: tls: - hosts: - demo.com secretName: tls-secret rules: - host: demo.com http: paths: - path: /web backend: serviceName: web-app servicePort: 80
Here is my situation, I'm on kubernetes (ingress), with two docker images: one dedicated to the web and the second one to the api.Under the next configuration (at the end of the message):/webwill show the front-end that will make some calls to/api,all good there.but/is a 404 since nothing is defined, I couldn't find a way to tell in the ingress config that/should redirect to/webapiVersion: extensions/v1beta1 kind: Ingress metadata: name: dev-ingress annotations: kubernetes.io/tls-acme: "true" nginx.ingress.kubernetes.io/rewrite-target: / spec: tls: - hosts: - demo.com secretName: tls-secret rules: - host: demo.com http: paths: - path: /api backend: serviceName: api-app servicePort: 8080 - path: /web backend: serviceName: web-app servicePort: 80
Default path on multiple nginx ingress rewrite
I was able to set up a remote private registry by referring to this:Remote access to a private docker-registrySteps:On registry host, rundocker run -p 5000:5000 registryOn client host, start Docker service bydocker -d --insecure-registry 10.11.12.0:5000(replace 10.11.12.0 with your own registry ip, and you might want to daemonize the process so it'll continue running after shell closes.)Edit: Alternatively, you can edit Docker's init script (/etc/sysconfig/docker for RHEL/CentOS, /var/lib/docker for Ubuntu/Debian). Add this lineother_args="--insecure-registry 10.11.12.0:5000", then do aservice docker restart. This is a recommended method as it daemonizes the Docker process.Now, try if it works:In client, download a busybox imagedocker pull busyboxGive it a new tagdocker tag busybox 10.11.12.0:5000/busyboxPush it to registrydocker push 10.11.12.0:5000/busyboxVerify the pushdocker search 10.11.12.0:5000/busyboxRemove all images and pull it from your registrydocker rmi busybox 10.11.12.0:5000:busyboxdocker pull 10.11.12.0:5000:busyboxRundocker imagesshould have the image you just pulled from your own remote private registry.
I need some tips on setting up a 'remote private Docker registry'.README.mdon Docker-Registry mainly focus on private registry running on the same host, does not specify how other machines can access it remotely (or maybe too complex to understand).So far I found these threads:Docker: Issue with pulling from a private registry from another server(Still an open thread, no solution offered. Further discussion onGithubgives hint on proxy, but how does that work?)Create a remote private registry(Maybe closest to what I'm looking for, but what command do I need to access the registry from other machines?)How to use your own registry(Again, this focuses on running registry on the same host. It did mention running on port 443 or 80 for other machines to access, but need more detail!)Running out of clues, any input very appreciated!
Setting up a remote private Docker registry
1 When speaking about http, webserver detects which of configured servers was requested by checking Host header. In you case, you tell nginx to proxy requests to another server, but instruct it to pass original Host header to that server. Obviously, there is no configuration on remote server, which could accept request with that domain. So it responds you with 404. To make it work, just change header to proxy_set_header Host www.example.com; where instead of www.example.com you should use same host as in proxy_pass directive. (or same variable) Share Improve this answer Follow answered May 12, 2016 at 18:32 Evgeny SoynovEvgeny Soynov 71433 silver badges1313 bronze badges 2 Is this the correct block? location /example/ { proxy_set_header Host www.example.com; proxy_set_header X-Real-IP $remote_addr; proxy_pass h*ttp://www.example.com; } When i try this i get indeed a different error but now a <title>500 - Internal Server Error</title> – Marco May 12, 2016 at 18:50 @Marco proxy_pass should contain url with protocol and uri. So that was okay in your first example proxy_pass http://example.com/; – Evgeny Soynov May 12, 2016 at 18:58 Add a comment  | 
As a Nginx newbie i am trying to get a reverse proxy working to an external domain. Later on I will need to port to an internal domain. When trying to reverse proxy to an external domain i seem to hit a wall and the response is a 404 cannot be found. The goal is when i try to access http://localhost/example the reverse proxy serves www.example.com. This is my config: server { listen 80; server_name localhost; location / { root /usr/share/nginx/html; index index.html index.htm; } location /example/ { proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_pass http://www.example.com/; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } } Any hint what i am doing wrong?
Nginx reverse folder location to external website
Your Python script is trying to access an environment variable called "my-api-key", but it's not found.If you're using bash, you can set the environment variable using theexportcommand before running your Python script:export my-api-key=your_apiJust replaceyour_apiwith your actual Grafana API key. After setting the environment variable, run your Python script in the same terminal:python grafana-exporter.pyThis should fix theKeyErroryou're seeing.And your script is expecting the environment variable to be namedgrafana_api_key, notmy-api-key. So you may want to set your environment variable as follows instead:export grafana_api_key=your_apiAnd make sure your Python code is trying to access the correct environment variable:API_KEY = os.environ["grafana_api_key"]This should resolve the issue and your script should successfully export Grafana dashboard information to a CSV file.
I have a grafana running in a container on a vm and I expose port 3000 on my localhost. I have a code in python that exports a dashboard information in CSV format, but when I specify the grafana API key I get the following error:File "grafana-exporter.py", line 10, in <module> API_KEY = os.environ["my-api-key"] File "/usr/lib/python3.6/os.py", line 669, in __getitem__ raise KeyError(key) from None KeyError: 'my-api-key'My code:import csv import os import requests HOST = 'http://localhost:3000' API_KEY = os.environ["grafana_api_key"] DASHBOARD_URI = '<dashboard-uri>' OUTPUT_CSV_FILE = 'dashboard_info.csv' def export_dashboard_info(): headers = {'Authorization': 'Bearer %s' % (API_KEY,)} response = requests.get('%s/api/dashboards/%s' % (HOST, DASHBOARD_URI), headers=headers) response.raise_for_status() dashboard_data = response.json()['dashboard'] # Prepare the CSV file with open(OUTPUT_CSV_FILE, 'w', newline='') as csv_file: writer = csv.writer(csv_file) # Write the header row with the keys of the dashboard_data dictionary writer.writerow(dashboard_data.keys()) # Write the data row with the values of the dashboard_data dictionary writer.writerow(dashboard_data.values()) print("Dashboard information exported to", OUTPUT_CSV_FILE) # Call the export function export_dashboard_info()`I am trying to export the API_KEY variable, and I expect to have an export of grafana dashboard in CSV format.
KeyError when trying to export information from Grafana API
I had the exactly same problem and spent a couple of hours... I guess you are using older version of nginx (lower than 1.7)? In nginx 1.7 you can use this directive: proxy_ssl_server_name on; This will force nginx to use SNI Also, you should set the SSL protocols: proxy_ssl_protocols TLSv1 TLSv1.1 TLSv1.2; For earlier versions you may be able to use this patch (but I can't verify that that is working): http://trac.nginx.org/nginx/ticket/229 2019 Update: You should avoid TLSv1 and TLSv1.1 and disable them if possible. I'll leave them in the answer as they are still valid for SNI.
NGINX acting as a caching proxy encounters problems when fetching content from CloudFront server over HTTPS: This is the extract from the NGINX's error log: 2014/08/14 16:08:26 [error] 27534#0: *11560993 SSL_do_handshake() failed (SSL: error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure) while SSL handshaking to upstream, client: 82.33.49.135, server: localhost, request: "GET /static/images/media-logos/best.png HTTP/1.1", upstream: "https://x.x.x.x:443/static/images/media-logos/best.png", I tried different proxy setting like proxy_ssl_protocols and proxy_ssl_ciphers but no combination worked. Any ideas?
NGINX caching proxy fails with SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure
We can consider this from the perspective of your personal computer - I think that this can connect to github when needed, and can connect to the shared drive where the other users have access, right?This repo can have two remotes defined: github and the shared server copy of the repo:git remote add github https://github.com/user/repo.gitgit remote add shared shared-machine://path/to/repo.git('github' and 'shared' are arbitrary labels I chose for these two remotes)You can then push and pull to github, and you can push and pull to the shared machine repo, from your personal machine copy of the repo.To get the changes from your users:git pull sharedTo push them to github:git push github
I have a setup where users (of a server) cannot reach github.com directly, but we can use git (and the GitHub app) with a local repo on a shared drive. That location can be mounted on other computers on our LAN, incl. my personal computer VPNing in. My question is how I could push it up to github.com to allow versioning with local copies checked out from there — the shared location on the server cannot be a git server for all.The same personal would also have another version of the same repo — checked out from github.com for offline use, or at least off the LAN. Then how can I also be the one committing server repo?
how to use github with two local repos (of the same project)
TheTLS handshakeprocess sets up asymmetrickey between both parties, potentially usingasymmetriccryptography in the process (the details depend on the exact algorithms that were negotiated between client/server). This way, the communication is encrypted on both ways, not only one-way.The thing that ultimately protects you from a MITM, though, is the fact that your browser does some form of hostname validation. The certificate presented by the server in the handshake is first checked for its validity. If that succeeds, your browser checks whether the certificate is bound to the exact host it is talking to. If this check would be omitted, a MITM attack would still succeed, even if the rest of the communication strictly followed the protocol, including all the cryptographic elements. The attacker could simply pretend to be any host and execute the rest of the protocol dutifully, you wouldn't know the difference.
Most of the wiki articles describe how client browser uses the public key (certificate) encrypt sensitive data (such as username/password) and send this encrypted data to server. Server will use private key to decrypt it. I get this part. But no clear information saying how server encrypt data and send back to browser.Use my online banking as example:(0) I already accepted trusted certificate (public key) from my online-banking.(1) Through SSL URL, My browser visithttps://myonlinebanking.com(2) I typed username/password to login. These data are encrypted, so the man-in-middle can only see meanless data.(3) Bank web server received my encrypted data, and use its private key to decrypt it and authenticate my account successfully.Now here are my questions:How bank sends back my data? Bank encrypt the response data by what key? If bank encrypted with "public key", the man-in-middle can see it just as I can see it. So the man-in-middle doesn't know my username/password, but he can still see my account balance?Thank you for your help.
How does SSL encrypt data from server to client?
If you're trying to use very large lists in 64 bit environments you need to enable large objects in the application configuration. http://msdn.microsoft.com/en-us/library/hh285054.aspx The OOM is likely due to the way Lists/ArrayLists allocate memory, which I believe is each time their boundary is reached, they attempt to double in size. The list cannot double from 2^24. You could theoretically maximize your list size by pre-specifying a size. (I.e. 2GB)
Given the opportunity to rewrite, I would, but anyway, the code as it stands: List<string> foobar; Then we add a bunch of strings to foobar. At count=16777216, we hit an out of memory limit. My understanding is that each string would be a different size. Indeed looking at the data (not my data), most are 2 or 3 characters. what is the max limit of data into list in c#? indicates that the max limit is: The maximum number of elements that can be stored in the current implementation of List is, theoretically, Int32.MaxValue - just over 2 billion. However: In the current Microsoft implementation of the CLR there's a 2GB maximum object size limit. (It's possible that other implementations, for example Mono, don't have this restriction.) In my example, I have, what, 16 million results * a few bytes? Task manager shows about a gig being used, but I have 8 gigs of RAM. 16777216 (2^24) seems like a fairly specific value - suspiciously like a limit, but I can't find any documentation anywhere to a) back this up or b) find a way around it? Any help would be appreciated. Some code: List<string> returnList = new List<string>(); SqlDataReader dr; // executes a read on a database, have removed that part as that bit works fine if (dr.HasRows) { while (dr.Read()) { returnList.Add(dr.GetString(0).Trim()); } } That's the simplified form, I now have some try/catch for the OOM Exception, but this is the actual code that's giving me grief.
I hit an OutOfMemoryException with List<string> - is this the limit or am I missing something?
First, use thekinesisvideoclient to obtain an Endpoint:import boto3 kinesis_client = boto3.client('kinesisvideo',region_name='us-west-2') response = kinesis_client.get_data_endpoint(StreamARN='...ARN...',APIName='GET_MEDIA')Theresponsevariable contains:{'ResponseMetadata': {'RetryAttempts': 0, 'HTTPStatusCode': 200, 'RequestId': '...', 'HTTPHeaders': {'x-amzn-requestid': '...', 'date': 'Tue, 10 Apr 2018 08:22:59 GMT', 'content-length': '74', 'content-type': 'application/json'}}, u'DataEndpoint': u'https://s-4010cf70.kinesisvideo.us-west-2.amazonaws.com'}Then, call thekinesis-video-mediaclient with the given endpoint:video_client = boto3.client('kinesis-video-media',endpoint_url='https://s-4010cf70.kinesisvideo.us-west-2.amazonaws.com',region_name='us-west-2') stream = video_client.get_media(StreamARN='arn:aws:kinesisvideo:us-west-2:...',StartSelector={'StartSelectorType': 'NOW'})Thestreamvariable contains:{u'ContentType': 'video/webm', u'Payload': <botocore.response.StreamingBody object at 0x7f1fab294850>, 'ResponseMetadata': {'RetryAttempts': 0, 'HTTPStatusCode': 200, 'RequestId': '...', 'HTTPHeaders': {'x-amzn-requestid': '...', 'transfer-encoding': 'chunked', 'content-type': 'video/webm', 'date': 'Tue, 10 Apr 2018 08:27:19 GMT'}}}
Under the boto3 docs:https://boto3.readthedocs.io/en/latest/reference/services/kinesis-video-media.html#KinesisVideoMedia.Client.get_mediait says that I need to run theGetDataEndpointAPI first to get an endpoint before I runGetMediabut it doesn't say how to feed that endpoint in?So I have tried to run:import boto3 kinesis_media = boto3.client('kinesis-video-media' region_name='region') stream = kinesis_media.get_media(StreamARN='my-arn', StartSelector={'StartSelectorType': 'EARLIEST'}) # this is not the endpointand that returns:ClientError: An error occurred (403) when calling the GetMedia operation: <AccessDeniedException> <Message>Unable to determine service/operation name to be authorized</Message> </AccessDeniedException>I am guessing cause endpoint wasn't specified but the clients of typekinesis-video-mediadon't have theget_data_endpointmethod which is required to get the endpoint url?
Boto3 kinesis video stream: Error when calling the GetMedia operation
After the increment, they are reboxed usingInteger.valueOf(), and for small absolute values (between-128and127by default), that uses the cached instances.
I've been reading over java caches for class and I'm not exactly sure why this code works.Integer x = new Integer(2); Integer y = new Integer(2); assert x != y; assert x.intValue() == y.intValue(); ++x; assert x != y; assert x.intValue() != y.intValue(); ++y; assert x == y; assert x.intValue() == y.intValue();I understand that initially x and y are not equal because they reference different objects, but why do they become equal after the ++?
Java cache and equality
In Amazon Cognito, the User Pool ID is considered to be a sensitive piece of information, and it is used only inAdminAPI calls. The SignUp API call is not AWS SigV4 Signed, and it is meant to run on the browser side instead of the server side.From the App Client ID, Cognito implicitly understands which User Pool you are referring to in your code. Hence, you can use the code in the documentation, and users will get added to your User Pool without the User Pool ID being a parameter in the API call.
In the aws-sdk cognito documentation there is a function listed calledsignUp()that quote "Registers the user in the specified user pool and creates a user name, password, and user attributes." However, there is no parameter for a user pool Id. How exactly does one specify the user pool they want to add to? At first glance it thought maybe it was just missing in the documentation, but I tried adding UserPoolId as a property in the parameters object, to which it responded with an error about an unexpected field. There is also no function parameter to accept the pool id. My only other guess was that maybe theCognitoIdentityServiceProviderobject accepted it in its constructor, but that also does not appear to be the case. I am aware that the API also provides the functionAdminCreateUser()to add users, but don't want to use it if there's a better way.documentation herehttps://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CognitoIdentityServiceProvider.html#signUp-propertyAny ideas?
CognitoIdentityServiceProvider.signUP() doesn't accept user pool id?