Response
stringlengths
15
2k
Instruction
stringlengths
37
2k
Prompt
stringlengths
14
160
After some time I created a working solution for this problem. I'm not sure why I got that error but here is a working solution:github actions configuraiton file:name: Node.js CI on: [pull_request] jobs: build: runs-on: ubuntu-latest strategy: matrix: node-version: [14.x] steps: - uses: actions/checkout@v2 - uses: secrethub/actions/[email protected]env: SECRETHUB_CREDENTIAL: ${{ secrets.SECRETHUB_CREDENTIAL }} DOCKER_USERNAME: secrethub://stavalfi/dockerhub/username DOCKER_PASSWORD: secrethub://stavalfi/dockerhub/access-token - name: install k8s uses: engineerd/[email protected]- run: minikube start - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - run: yarn install - run: yarn build - run: eval $(minikube docker-env --shell sh) && yarn workspace simple-service build:docker # build the docker image and let k8s use it locally - run: eval $(minikube docker-env --shell sh) && yarn workspace k8test-monitoring build:docker # build the docker image and let k8s use it locally - run: DEBUG=k8test:* yarn test # create k8s deployments from the docker-images from the last 2 steps
I have a monorepo of 2 packages:produces a docker-imagehas tests that deploy (locally) to k8s the image from package-1to make sure that k8s will talk to the local docker deamon and take the image from there, in my local machine, I run:eval $(minikube docker-env --shell sh)locally build the docker-image in package-1 (no docker-push)run the tests in package-2In github-actions, I tried to do run the same commands, but the first step doesn't work: (https://github.com/stavalfi/k8test/pull/6/checks?check_run_id=785330120)Run eval $(minikube docker-env --shell sh) /home/runner/work/_temp/932fe76c-855f-4ed6-9fa3-dcd5cea6df7e.sh: line 1: README.md: command not found ##[error]Process completed with exit code 127.I have no-idea what does this error means and why "README.md" appears in the error.Question:Is there any way to make it work? even an alternative way to make sure that in github-actions, k8s will find the docker-image that I build?
how to build docker-image and use it with k8s in github actions?
atis the wrong tool for this job.You're looking forcron.8 pm every day would be :0 20 * * * /bin/execute/this/script.sh8 pm every monday would be :0 20 * * 1 /bin/execute/this/script.sh
I recently came across the at command on the command line, but I am wondering whether I can write a bash script that somehow enables me to tell the at command to run at 8 pm every day, or every monday, every week etc. basically at regular intervals. How is this possible?
Using linux' at command - scheduling daily / weekly possible?
You can't match against the query string in mod_alias'sRedirectorRedirectMatch. You need to use mod_rewrite's%{QUERY_STRING}or%{THE_REQUEST}variables. Try:RewriteEngine On RewriteCond %{QUERY_STRING} ^m=1$ RewriteRule ^(.*)$ /$1? [L,R=301]This will redirect any request that has the "m=1" query string and remove it.
I have very weird problem.My WordPress site gets traffic to the same page with different additional parameters.Example:mysite.com/page1.html?m=1 mysite.com/page1.htmlIt is the same page, but?m=1makes WP show 404 error page.I tried 301 redirect like this (in actual HTACCESS file i also usehttp://but here I cannot):Redirect 301 /page1.html?m=1 mysite.com/page1.htmlBut this does not do anything.Traffic comes from google, so I cannot change this URL structure - I have to work with what I got ... So how I fix this???It could be either WP or HTACCESS problem ... I searched and cannot find anything - i get results for M1 rifle :(Please help - this is a live site
301 Redirect not working (WordPress) - [ Probler with ?m=1 in URL ]
1 You could rebase branch2 on top of master using --update-refs which is a newish option that will also update references that are setup in the path to branch2, so should move the position of branch1 . git checkout branch2 git rebase --update-refs master The kind of step by step way would be: git checkout branch1 git branch temp # let's set a temporary marker before I move it git rebase master # now time to rebase branch2 git rebase --onto branch1 temp branch2 # remove the temporary branch if things went fine git branch -D temp The last rebase will rebase commits in the temp..branch2 range on top of branch1 Share Improve this answer Follow edited Feb 1, 2023 at 22:07 answered Feb 1, 2023 at 21:45 eftshift0eftshift0 28k44 gold badges4141 silver badges6868 bronze badges Add a comment  | 
My Scenario is this : From master branch to feature branch1 , add changes to branch1 then create another branch from branch1 called branch2, then add changes to branch2. If there are then pending changes to the master branch , what's the best approach to sync all branches with the master branch Branch creation as follows Master to F1 then F1 to F2
How to sync multiple feature branches with master in git
Copy between S3 Buckets AWS (just recently) released a command line interface for copying between buckets. http://aws.amazon.com/cli/ $ aws s3 sync s3://mybucket-src s3://mybucket-target --exclude *.tmp .. This will copy from one target bucket to another bucket. See the documentation here : S3 CLI Documentation
I have been on the lookout for a tool to help me copy content of an AWS S3 bucket into a second AWS S3 bucket without downloading the content first to the local file system. I have tried to use the AWS S3 console copy option but that resulted in some nested files being missing. I have tried to use Transmit app (by Panic). The duplicate command downloads the files first to the local system then uploads them back to the second bucket, which quite inefficient.
AWS S3 copy files and folders between two buckets
The path you use in your nginx configuration is not the path where the file was generated:... have been saved at: /etc/letsencrypt/live/poemhub/fullchain.pemvs."/etc/letsencrypt/live/poemhub.top/fullchain.pem": PEM_read_bio_X509_AUX() failed ...
when I am using this command to generate a certificate of my website:/usr/local/bin/certbot certonly -d '*.poemhub.top' \ --manual --preferred-challenges dns \ --cert-name=poemhub \ --key-type=ecdsa \ --server https://acme-v02.api.letsencrypt.org/directoryit tell me generate success:IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/poemhub/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/poemhub/privkey.pem Your certificate will expire on 2021-10-10. To obtain a new or tweaked version of this certificate in the future, simply run certbot again. To non-interactively renew *all* of your certificates, run "certbot renew" - If you like Certbot, please consider supporting our work by: Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate Donating to EFF: https://eff.org/donate-lenow I am using this command to reload the nginx:nginx -s reloadand tell me this error:nginx: [emerg] cannot load certificate "/etc/letsencrypt/live/poemhub.top/fullchain.pem": PEM_read_bio_X509_AUX() failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: TRUSTED CERTIFICATE)where is going wrong? what should I do to fix the problem?
PEM_read_bio_X509_AUX() failed (SSL: error:0909006C:PEM routines:get_name:no start line:Expecting: TRUSTED CERTIFICATE)
You can't. You may try to allocate a memory on the heap at the beginning of you program, and compare the address to the pointer you want to free, but it will not be accurate in many of the cases. And what you might find and use on one platform after some research of its memory management, might not be relevant on the next. An alternate way is to add a memory management module to your program, which will wrap the malloc, free etc. functions and will keep track of all allocated memory and will call free only if the pointer appears in his list. While this might seem like a lot of work to avoid memory leaks, I've found it very convenient many times. EDIT As mentioned in comments, the best way to decide is simple - free it in a place where you know if it's was located on the heap or not. I cannot tell you how easy it is in your case, but usually it shouldn't be too hard, many programs / programers did it before, and I doubt someone actually tried to check where the memory was allocated at.
A block of memory can be allocated statically, in the stack or in the heap. I want to know a way to detect if a pointer points to the heap. I work with Windows and Linux and it is not a problem a different solution for each OS. I use GCC and Mingw. If I could know where the heap begins and where it ends, I think the problem can be solved. I think that I can detect the bottom and the top of the stack in order to know if the block is in the stack, but if there are multiple threads, then there are multiple stacks. Even I could to know where is the static memory, I think I will have problems with static memory blocks of shared libraries. I think I will have a problem if the pointer does not point to the beginning of the block: type* x = &(pointer[3]);
How to detect where a block of memory was allocated?
The short answer is no as of this writing. AWS Codebuild does not support the webhook for when a tag is created.My original question was targeted towards creating an easy build system with semantic version attached. I got around the tag issue by creating a branch filter and a bash script.1) I made my branch filter bebuild-[0-9]+.[0-9]+.[0-9]+.2) The I wrote a bash script that:increments the semantic version, triggering a change in the repo.commits the change to my whatever my deploy branch is. (master)creates a new branch with a name that matches the regex above, that also contains the version within it. e.g, build-0.2.11, build-1.2.3, etc.deletes the newly created branchJust the creation of the remote branch will trigger github to fire the push webhook over to AWS. The webhooks has the name of the branch in it, which you can utilize in your codebuild script."ref": "refs/heads/build-0.2.11"
As the title states, I want to know if there is a tag on the commit SHA that triggered the AWS codebuild.I have looked at all the Env variables using printenv in my buildspec.yml file and it seems like the only thing AWS codebuild captures from git is the commit hash. I want to know if there's a simple way of getting the tag.I am pushing the commit and the tag to git in one command:git push origin <releaseBranch> : <version>I am looking github's webhook. This is the response I get back from CodeBuild:{"response":"Webhook received and build started: https://us-west-2.console.aws.amazon.com/codebuild/<projectSpecificStuff>/view/new","statusCode":200}And at the very top of body in the POST from the webhook is:{ "ref": "refs/tags/0.0.2", "before": "0000000000000000000000000000000000000000", "after": "6258048d01ca4aa18e7c27dac2d7a51ec5640421", "created": true, "deleted": false, "forced": false, "base_ref": "refs/heads/release-script", ... }
AWS Codebuild -- How to read tag on the commit when buildspec.yml is executed?
There aremultiple waysto achieve what you want, but simplest is to use theprefix query, if you just index your data directly to Elasticsearch without defining mapping, it will automatically create two fields for you, and on.keywordfield you can use the prefix query as shown below.Index sample documentsPUT <your-es-index>/_doc/1 { "title" : "what is my name" } PUT <your-es-index>/_doc/2 { "title" : "what is google" } PUT <your-es-index>/_doc/3 { "title" : "what is stackoverflow" } PUT <your-es-index>/_doc/4 { "title" : "how to search" }Search queryPOST /_search{ "query": { "prefix": { "title.keyword": { "value": "what is" } } } }Your expected search results"hits": [ { "_index": "72391510", "_id": "1", "_score": 1.0, "_source": { "title": "what is my name" } }, { "_index": "72391510", "_id": "2", "_score": 1.0, "_source": { "title": "what is google" } }, { "_index": "72391510", "_id": "3", "_score": 1.0, "_source": { "title": "what is stackoverflow" } }
querywhat is my namewhat is googlewhat is stackoverflowhow to searchSo, I would like to have an Elasticsearch Index which has documents as above. I would like to fetch all the results which prefix matches the query. For example, when queried for "what is", I need {"what is my name", "what is google", "what is stackoverflow"} as results, exact prefix match.How do I go about creating an index? and Example queries, if possible.Thanks in advance.
Elasticsearch query: Fetch all the results which prefix matches the query for typeahead, autocomplete feature
The idea behind the link between GitHub issue and Mylyn is to define aquery:GitHub issue task repositories support creating queries that filter by the following fields:State (open or closed)MilestonesMentionsAssigneeLabelsSo if you don't define a query for the issues (especially for the ones assigned toyouor your team), you won't see them.That query will use theGitHub v3 API for issues.(Huboardis an example of another service, beside Egit, which uses that API: as described inHuboard – Github issues made awesome, byRyan Rauh)
I'm using this GitHub Mylyn connector:http://marketplace.eclipse.org/content/github-mylyn-connectorHowever, when someone is creating an issue on GitHub itself, it doesn't get updated in my tasks in Eclipse. I am working in a team, therefore want to have the possibility to share all the tasks. The idea behind Mylyn was to create tasks, sync it with GitHub and everyone else will just sync their task list against the issue list on GitHub. As I mentioned, somehow it doesn't sync any tasks that were created on GitHub itself, therefore I assume that tasks I create in Mylyn and sync with GitHub won't be synced to my colleagues computer as well.Any solution for this?
GitHub Mylyn connector: Getting issues from GitHub
kubectl config set-clustersets a cluster entry in yourkubeconfigfile (usually found in$HOME/.kube/config). Thekubeconfigfile defines how yourkubectlis configured.The cluster entry defines wherekubectlcan find the kubernetes cluster to talk to. You can have multiple clusters defined in yourkubeconfigfile.kubectl config set-contextsets a context element, which is used to combine a cluster, namespace and user into a single element so thatkubectlhas everything it needs to communicate with the cluster. You can have multiple contexts, for example one per kubernetes cluster that you're managing.kubectl config use-contextsets your current context to be used inkubectl.So to walk through your commands:kubectl config set-cluster test --server=https://127.0.0.1:52807creates a new entry inkubeconfigunder theclusterssection with a cluster calledtestpointing towardshttps://127.0.0.1:52807kubectl config set-context test --cluster=testcreates a new context inkubeconfigcalledtestand tells that context to point to a cluster calledtestkubectl config use-context testchanges the the current context inkubeconfigto a context calledtest(which you just created).More docs onkubectl configandkubeconfig:https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/https://kubernetes.io/docs/reference/kubectl/cheatsheet/#kubectl-context-and-configuration
While using this command for RBAC"kubectl config set-cluster test --server=https://127.0.0.1:52807"the IP here is from the kind-cluster that I am running after which I use"kubectl config set-context test --cluster=test"followed by required credentials & switch to the context by"kubectl config use-context test"and I am in the test context but with the first command I am configuring the config file I got that but m I making a cluster within a cluster what you guys understand please help me clear my doubt what is it actually doing?
What does it mean "kubectl config set-cluster" what does it actually does?
Yes, that's true, it'sreadinessprobedesigned to.When readiness probe is not passed, the pod will be inNotReadystatus, thus doesn't appear in the Endpoint list, while only the Pods in the Endpoint list will be resolved by coredns. This can effectively prevent the end user from accessing the newly started Pod when Pod's service not ready yet.
Does Kubernetes wait for readiness probe to pass to add the POD entry in DNS? I have observed that POD hostname do not have any entry in DNS if readiness probe is still running after the POD start. Once the readiness probe pass, entry is created in the DNS.My openshift version is 3.11 which has kubernetes version 1.11
Does Kubernetes wait for readiness probe to pass to add the POD entry in DNS
Without seeing your code it is difficult to find exact issues. But I you should start from finding code where new objects are instantiated/destroyed. It causes GC to collect unused objects and allocate new memory. And soon your free memory becomes so fragmented that there is no suitable memory area to allocate new object. I strongly recommend to read articles about optimization for Unity
So I already asked this question on the unity forums but that didn't help me a lot :/. Today I decided to give my game a try with friends so basically I created a server so other clients/friends could connect to it. After about 20 minutes of playing my game crashed and I quickly checked task manager and my game was using about 3.5 GB of RAM! PHOTO HERE When I looked at the log it said something like this: Unity Player [version: Unity 4.6.1f1_d1db7a1b5196] mono.dll caused an Access Violation (0xc0000005) in module mono.dll at 0023:101071a1. Error occurred at 2016-07-04_163050. C:\Users\Cooler Master\Desktop\TL\TL.exe, run by Cooler Master. 77% memory in use. 0 MB physical memory [1814 MB free]. 0 MB paging file [1039 MB free]. 0 MB user address space [68 MB free]. Write to location 00000000 caused an access violation. So in my game there is something that keeps eating my RAM. It takes about 3MB per second of ram when the game is running. I found some information on internet about Resources.UnloadUnusedAssets but I don't know how to write a script like that! I knew how to write in c# but only the easy scripts like GUI,Newtorkinf,Physics etc.. Also I downloaded unity pro from kickasstorrent only to see profiler window but that didn't help me at all Thank very much for any reply ! Also if you want to check out the game and see what's happening : http://gamejolt.com/games/thuglifealpha/61660 Thanks again! :)
Unity- Standalone build run out of memory
is a lower number than 19018. Also, I think youhaveto be in the Insider Preview program at the moment to enable that option.https://docs.docker.com/docker-for-windows/wsl-tech-preview/I'm in the same boat as you; I'm dying to use it as well, but don't want to join the Insider program, so I'm just trying to be patient, and wait it out.
Closed.This question does not meetStack Overflow guidelines. It is not currently accepting answers.This question does not appear to be abouta specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic onanother Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.Closed3 years ago.Improve this questionI'm following these instructions to run my Docker Daemon on WSL 2 on Windows 10:https://medium.com/@callback.insanity/upgrading-to-wsl-2-9883688fcfa5But, when I try to Enable the experimental WSL 2 based engine, I cannot select the checkbox, as seen here:I am runningWindows 10 build 1909The message here reads:(requires Win 10 build 19018+)I am not on the fast track or Insider Preview program (and I don't want to be), but it is not clear to me at all if my build satisfies this requirement. I am running WSL 2 (and yes, it's pretty nice, aside from the fact that it doesn't seem to be working with Docker as I'd prefer).Is the problem I'm facing that my Windows build version is too low, or is there something else I should try?Update:As pointed out in comments below, theversion numberof my Windows is different than thebuild number. I checked the build number by going into system information and seeing the my build number is 18362.
"Enable the experimental WSL 2 based engine" not selectable [closed]
I have found the solution to this.You need to create a new branch then push the commits to that branch then create the pull request that compares the newly created branch and the master branch.ShareFollowansweredAug 16, 2018 at 22:28JamesJames1,93433 gold badges1313 silver badges3131 bronze badgesAdd a comment|
I am attempting to create a pull request from Android Studio. I have edited a file, commited the file, and then when I clickCreate pull requestit tries to create it and I receive the error below:Can't Create Pull Request Can't create pull request 422 Unprocessable Entity - Validation Failed [PullRequest; null]custom: No commits between master and masterMy branches and remotes are set up correctly as far as I know. I am able to directly push as well so I know it can access GitHub.This is what theCreate pull requestmenu looks like:This is what myGit Remotesmenu looks like:My questions is am I missing a step that I need to do before I create the pull request? If not, why am I receiving this error?
Creating GitHub pull request from Android Studio gives error
Retrofit itself does absolutely no caching.If you want caching, it will either have to be at the application layer above Retrofit which knows about your domain and how to cache things in it or it needs to be at the HTTP client layer below Retrofit which knows the semantics of HTTP.OkHttpis an HTTP client also by Square which supports the semantics of caching server responses. If the response from the server has theCache-Controlheader, for example, it will be cached so that subsequent requests for the same resource pull from the cache.
I'm trying to implement Retrofit in my app, and everything it's working just fine, except that the requests are not cached.So I have:@GET("/mobile/api.php") public void getPromos( @QueryMap Map<String, String> options, Callback<ResultPromotions> callBack);.....requestFacade.addHeader("Authorization", authorizationValue); requestFacade.addHeader("Cache-Control", "public, max-age=600");....RestAdapter adapter = new RestAdapter.Builder() .setRequestInterceptor(requestInterceptor) .setClient(new OkClient(okHttpClient)) .setEndpoint(ENDPOINT) .setConverter(new GsonConverter(gson)) .setLogLevel(RestAdapter.LogLevel.FULL) .build();So my question is: dose retrofit cache the authorization requests? Or there is no way to cache this type of requests?
Does Retrofit cache the authorization requests
From Creating an Amazon EBS-Backed Linux AMI - Amazon Elastic Compute Cloud: To create an AMI from a snapshot using the command line You can use one of the following commands. For more information about these command line interfaces, see Accessing Amazon EC2. register-image (AWS CLI) Register-EC2Image (AWS Tools for Windows PowerShell) The register-image documentation page says: You can also use RegisterImage to create an Amazon EBS-backed Linux AMI from a snapshot of a root device volume.
I know that AMI can be created from EBS snapshot on EC2 console. I want to operate this AMI creation not on the AWS console but with the AWS CLI command. The aws ec2 copy-image command does not have any EBS Snapshot option to specify. Is there any way to do this with CLI or calling APIs?
How to create AMI from EBS snapshot with AWS CLI
There are several problems with your unsuccessful approach: proxy_set_header sets the header that goes to the upstream server, not to the client. So even if $sent_http_location hadn't been empty, your configuration couldn't possibly work as you wanted it to. $sent_http_<header> variables point exactly to the same area of memory as the response headers that will be send to the client. So when proxy_hide_header takes effect, the specified header is being removed from the memory along with the value of the corresponding $sent_http_<header>. set_escape_uri works at a very early stage of the request processing, way before proxy_pass is called and the Location header is returned from the upstream server. So it will always process the at that time empty variable $sent_http_location and the result also will always be the empty variable. The last problem is the most serious. The only way to make set_escape_uri work after $sent_http_location0 is to force Nginx to leave the current location and start the processing all over again. This can be done with the $sent_http_location1 trick: $sent_http_location2 Note the use of $sent_http_location3 instead of $sent_http_location4. When Nginx leaves the context of the location, it assumes that the request will be proxied to another upstream, or processed in some other way, and so it clears the headers recieved from the last $sent_http_location5, to make room for new response headers. Unlike $sent_http_location6 vairables, which represent response headers that will be send to the client, $sent_http_location7 variables represent response headers that were recieved from the upstream. Because of that, they are only replaced with new values when the request is proxied to another upstream server. So, once set, these variables can be used at any moment, they will not be cleared.
I have a web application that wants to access files from a third party site without CORS enabled. The requests can be to an arbitrary domain with arbitrary parameters. I'm sending a request to my domain containing the target encoded as a GET parameter, i.e. GET https://www.example.com/proxy/?url=http%3A%2F%2Fnginx.org%2Fen%2Fdocs%2Fhttp%2Fngx_http_proxy_module.html Then in Nginx I do location /proxy/ { resolver 8.8.8.8; set_unescape_uri $dst $arg_url; proxy_pass $dst; } This works for single files, but the target server sometimes returns a Location header, which I want to intercept and modify for the client to retry. Basically I would like to escape $sent_http_location, append it to https://www.example.com/proxy/?url= and pass that back to the browser to retry. I've tried doing set_escape_uri $tmp $sent_http_location; proxy_redirect $sent_http_header /pass/?v=$tmp; but this doesn't work. I've also tried saving the Location header, then ignoring the incoming header with proxy_hide_header and replacing it with my own proxy_set_header but ignoring causes me to lose the variable saving it. How can I configure Nginx to accomplish this handling of redirects so that I could pass a encoded URL would be returned to the user when the proxied site redirects?
Nginx proxy intercept redirect and pass custom redirect to client
It can works but it requires that the containers are aware of the environment variables. So you may need to declare the variable in theDockerfileand you must use the environment variable in theCMDinstruction that is used to start the process in the container. The environment variable will be updated with the value you provided in the kubernetes manifest.See below, a very simple Dockerfile to demonstrate the usage:FROM openjdk:11 ENV JAVA_OPTIONS="" COPY myapp.jar myapp.jar CMD java ${JAVA_OPTIONS} -Dmy.other.java.property=value -jar myapp.jar
I need to set a Java Environment Variable: -Djavax.net.ssl.trustStore=classpath:store. I am using helm charts with azure devops to release the image onto Openshift. In the deployment.yaml, I have tried multiple options to try to set the env variable but in vain. One example is as per below:spec: containers: - name: {{ .Chart.Name }} env: - name: JAVA_OPTIONS value: "-Djavax.net.ssl.trustStore=classpath:store"Thanks to guide.Ashley
setting Java Environment Variable in JIB Image from Helm
The git.exe of "GithHub for Windows" is located at: C:\Users\<user>\AppData\Local\GitHub\PortableGit_{hash}\bin\git.exe It seems like the hash in the path is different on different systems. By default Github for Windows clones github repos over HTTPS. Just for your demonstration purpose, in the VCS root setting of Teamcity build, you can use https url of your Github repo and choose "Password" as the "Authentication Method" in the "Authentication settings" section. If you use "agent-side checkout", using "Password" as authentication method is supported only if you have Teamcity 7.1.2+ and git version 1.7.3+. See Git VCS settings Teamcity and Teamcity issue TW-18711.
I am using TeamCity 7.1, running it on my Windows development machine. I have a team using GitHub for Windows. I am working on a demo for continuous integration. I want to teach the others how to setup TeamCity to work with a GitHub account. The less configuration they have to do the better. TeamCity is asking for the path to the git executable and an ssh key. I've done this many times on my Ubuntu box, no problem, but never on a Windows box. It would be nice if I could reuse the GitHub for Windows command line and its private key store just for demonstration purposes. Is this possible?
Using TeamCity with GitHub for Windows
+50Nice Question. If you look the problem outside the box, it is fairly easy.When you retrieve 3rd party server image, just copy that images and put it in your server or in CDN. And, use it. For this you have to setup some method something like# app/model/image.rb def image_link(name_of_image) if File.exist? "/some/#{name_of_image}.jpg" path = "/some/#{name_of_image}.jpg" else external_image_link = external_api_call(name_of_image) DownloadImageWorker.perform_async(external_image_link) // perform it asynchronously external_image_link end
Our webapp will perform API calls to retrieve images. These images can be cached for a reasonable amount of time, as stated in the terms, so we don't have to hit up the other website's servers on every page request.I am new to caching, but I just watched some Railscasts about some different methods.page caching,fragment caching,dynamic page caching. They all help decrease the requests and therefor the speed ofmyapp.But how would I go by 'caching' images from another site on my servers? What is the correct way to do so? Are there any functions to serve this purpose?My attemptwould be to add a timestamp,cache_outdates_atto myImagemodel and set it one month into the future. Whenever the image get's loaded again it would update the timestamp.Then I'd add a cronjob to check for outdated images and then delete them.
server side image caching
I believe it is a combination of both... You can tell that "X-Powered-By: PHP/5.3.6-6~dotdeb.1" comes from PHP and "Server: nginx" comes from NGINX.You can alter the headers in PHP as follows:The gzip header most definitely comes from NGINX as it is compressing the output (html) to the browser. PHP can "add" to the headers by calling a function like the one above. Then the server combines it with the PHP headers and serves the request.It depends on your server whether or not the PHP headers take precedence over the server headers.Hope this helps.
When I simply echo something out of php file, I do not send any headers intentionally, however - there are some default headers present anyway when I look at firebug response:response headers:HTTP/1.1 200 OKServer: nginxDate: Thu, 23 Jun 2011 19:33:51 GMTContent-Type: text/htmlTransfer-Encoding: chunkedConnection: keep-aliveVary: Accept-EncodingX-Powered-By: PHP/5.3.6-6~dotdeb.1Expires: Thu, 19 Nov 1981 08:52:00 GMTCache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0Pragma: no-cacheContent-Encoding: gzipI'm curious - are these default response headers set by the server(nginx) or by PHP?
Where are these extra HTTP headers coming from?
1 What you need to do is supervise your file using inotify, and whenever this file changes, call the Docker API so that it resets the container. In order to call the Docker API from inside a container, you mount the Docker socket inside the container like this: docker container run -it -v /var/run/docker.sock:/var/run/docker.sock ubuntu You then install the required utilities inside the container: apt-get update; apt-get install -y curl inotify-tools You then write the script that should be called whenever your target file changes: echo "curl --unix-socket /var/run/docker.sock -X POST http:/v1.24/containers/<container_to_reset>/restart" > script chmod +x ./script # Make sure the script is executable Finally, you run a loop that executes your script whenever the target file is modified: while inotifywait -e close_write <target_file>; do ./script; done Share Follow edited Apr 7, 2019 at 19:31 answered Apr 7, 2019 at 16:08 user10697425user10697425 1 I don't know this .sock file things. So, I will try & get back – Satish Patro Apr 12, 2019 at 13:13 Add a comment  | 
I have a spring-boot application running on java images in container. In Dockerfile I am copying jar file. Then build custom image for my project & run it I am thinking what if I will volume-map my jar file. At least it will run for the first time. I want some functionality like when I change volume map file in my host computer the docker need to be rerun. For HTML, nginx will work fine as it is just rendering html files in the particular folder without rerun. But, I doubt if it will work for java For rerun automatically what is the commands. Will it happens automatically?
docker re-run automatically when volume map data get changed
Change your document root.My vhost config looks like this<VirtualHost *:80> ServerName mysite.com DocumentRoot /full/path/to/public/web/symfony-project/web DirectoryIndex app.php </VirtualHost>ShareFolloweditedApr 15, 2013 at 5:58answeredApr 14, 2013 at 19:24Thomas KThomas K6,17655 gold badges4040 silver badges5656 bronze badges2I can't try it before tomorrow, but I will not forget to accept your answer if it's fit ;)–PierrickouwApr 19, 2013 at 11:50Ok, fine ! Now, I have an issue with the upload files, but I have the solution, thanks !–PierrickouwApr 20, 2013 at 21:40Add a comment|
I'm trying to install my local symfony application on a remote server. The application is currently installed in a public directory. So I can access my app withwww.mysite.com/public/webTo get rid off thepublic/webpart, I created a.htaccessin the server root with the following :RewriteEngine on RewriteCond %{HTTP_HOST} ^site.com$ [NC,OR] RewriteCond %{HTTP_HOST} ^www.mysite.com$ RewriteCond %{REQUEST_URI} !public/web/ RewriteRule (.*) /public/web/$1 [L]Now, I can access withwww.mysite.comand it's work fine ! But, all the link and the assets have kept thepublic/webpart.It works, but I want to remove this part.There is probably a configuration with thetwigfunctionpathandasset, but I can't find it. Any idea ?Thanks.
Proper way to remove web directory from the path twig function in the url
If you don't actuallywantthe dump (why would you in CI?) put this in yourtest.rb:config.active_record.dump_schema_after_migration = falseNow, no more need for PG tools (besides the client driver) in the ruby container.ShareFollowansweredSep 28, 2019 at 20:42cluesquecluesque1,1201111 silver badges1717 bronze badgesAdd a comment|
I have postgres container and a ruby container. When running docker-compose run web rake db:migrate I got an error like thisrake aborted! failed to execute: pg_dump -s -x -O -f /usr/src/app/db/structure.sql --schema=public --schema=partitioning docker_rails_dev Please check the output above for any errors and make sure that `pg_dump` is installed in your PATH and has proper permissions. /usr/local/bundle/gems/activerecord-4.2.7.1/lib/active_record/tasks/postgresql_database_tasks.rb:90:in `run_cmd' /usr/local/bundle/gems/activerecord-4.2.7.1/lib/active_record/tasks/postgresql_database_tasks.rb:55:in `structure_dump' /usr/local/bundle/gems/activerecord-4.2.7.1/lib/active_record/tasks/database_tasks.rb:183:in `structure_dump' /usr/local/bundle/gems/activerecord-4.2.7.1/lib/active_record/railties/databases.rake:279:in `block (3 levels) in <top (required)>' /usr/local/bundle/gems/activerecord-4.2.7.1/lib/active_record/railties/databases.rake:53:in `block (2 levels) in <top (required)>' /usr/local/bundle/gems/activerecord-4.2.7.1/lib/active_record/railties/databases.rake:45:in `block (2 levels) in <top (required)>' Tasks: TOP => db:structure:dump (See full trace by running task with --trace)The pg_dump command is available in the postgres container but not in ruby container but I have linked them together in mydocker-compose.ymlfile.
pg_dump error while running rake db:migrate
There are multiple ways to deploy Prometheus.It would be helpful if you were to include a link to the tutorial that you're following.It's possible that the deployment was unsuccessful.Can you enumerate the resources in themonitoringNamespace?kubectl get all --namespace=monitoringAre the Pods all running? If not, that's the first problem.In the list of Services (kubectl get services --namespace=monitoring), is there a service that exposes9090/tcp? If so, this is likely the Prometheus service that you wish to use.Is it namedprometheus-server?I've deployedkube-prometheusto a Kubernetes cluster and the Prometheus web client is accessed through a service namedprometheus-k8s:kubectl port-forward service/prometheus-k8s --namespace=monitoring 9090
I followed a tutorial to lauch a prometheus seerver in aks. After the deployment of pods, I run a command : kubectl --namespace monitoring port-forward prometheus-server 9090But when i check in the browser I have no access to the local page of prometheus. I want to precise that i did all step il azure cloudshell.Somebody has solutions ?Thanks
Cant see Prometheus server on localhost:9090
I gave up trying to pass the data through the context. However, I was able to pass the data through the Payload param:client.invoke( FunctionName='LambdaWorker', InvocationType='Event', LogType='None', Payload=json.dumps(payload) )And then to read it from event parameter inside invoked lambda:ctx = json.dumps(event)
I'm trying to get working two basic lambdas using Python2.7 runtime for SQS message processing. One lambda reads from SQS invokes and passes data to another lambda via context. I'm able to invoke the other lambda but the user context is empty in it. This is my code of SQS reader lambda:import boto3 import base64 import json import logging messageDict = {'queue_url': 'queue_url', 'receipt_handle': 'receipt_handle', 'body': 'messageBody'} ctx = { 'custom': messageDict, 'client': 'SQS_READER_LAMBDA', 'env': {'test': 'test'}, } payload = json.dumps(ctx) payloadBase64 = base64.b64encode(payload) client = boto3.client('lambda') client.invoke( FunctionName='LambdaWorker', InvocationType='Event', LogType='None', ClientContext=payloadBase64, Payload=payload )And this is how I'm trying to inspect and print the contents of context variable inside invoked lambda, so I could check logs in CloudWatch:memberList = inspect.getmembers(context) for a in memberList: logging.error(a)The problem is nothing works and CloudWatch shows user context is empty:('client_context', None)I've triedexample1,example2,example3,example4Any ideas?
How to invoke another lambda async and pass context to it?
A lookahead may help: ^(?!.*resolve).*\.(?:css|js|gif|jpeg|jpg|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ (?!.*resolve) makes sure no resolve exists in the string. See proof & explanation
I am not a god in Regular Expressions and stuck with a complex location regex. I have a location block in my nginx config to make sure images and other media are cached. But if "resolve" is in the URL it should not match and skip the block. I can't get it to work. I have looked at a negative lookbegind but I think I do not completely understand how it works. This is my block: location ~* \.(?:css|js|gif|jpeg|jpg|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ { //caching stuff } It should match the following URL: /media/cache/ps_product_admin_thumb/productimages/image.jpg But not the following: /media/cache/resolve/ps_product_admin_thumb/productimages/image.jpeg Anyone who can send me in the right direction?
Regex in nginx location match extension without "resolve"
You misunderstand howinternalandX-Accel-Redirectwork.The main idea is that you go to some URL which is proxied to app. Then app decides whether you should get access to file or not. In former case it response withX-Accel-Redirectto protected url (one withinternal).So you should go to some other URL, e.g.http://localhost:4000/get/files/test.jpgand your application could look like this:var http = require('http'); http.createServer(function (req, res) { if (req.url.indexOf('/get/files/') == 0) { if (userHasRightToAccess()) { res.setHeader('X-Accel-Redirect', res.url.slice(4)); res.end(''); } else { // return some error } } else { console.log(req.url); res.end('works'); } }).listen(3000);
I'm trying to set up authorized file access on nginx backed by node.js. For some reason all the examples don't work for me. I'm trying to server files from/data/private/filesMy nginx configuration:... server { listen 4000; server_name localhost; location / { proxy_pass http://127.0.0.1:3000/; } location /files { root /data/private; internal; }My node server.js:var http = require('http'); http.createServer(function (req, res) { console.log(req.url); res.end('works'); }).listen(3000);When I requesthttp://localhost:4000/xyzthen the request is correctly being passed on to node. When I requesthttp://localhost:4000/files/test.jpgI just get a 404 and nothing gets passed to node. What am I doing wrong? When I commend outinternalthen test.jpg gets served correctly by nginx directly, so I assume the paths are correct?I'm pretty sure I had this working at some point before but on a different server somewhere maybe with a different node and nginx version. Tried it with nginx 1.6.0 and 1.2.6, node v0.10.21. I've also added all the proxy_set_header and proxy_pass options that you find in all the examples, nothing works. I'm running this in a Vagrant based Ubuntu VM right now, but doesn't work on Mac either.I know that I have to set the header throughres.setHeader("X-Accel-Redirect", req.url);, but that's not the issue here as I don't even get to that phase where I could set the required header in node.
Nginx X-Accel-Redirect not working with node.js
42 I had the same issue. BitLocker cant be disabled as it is a company policy. I Resolved it by doing the following: Step 1: Open Command Prompt and Type: regedit Step 2: Navigate to "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Policies\Microsoft\FVE FDVDenyWriteAccess". Change "FDVDenyWriteAccess" to "0". Step 3: Restart Docker and it should work as expected. Note: You should be an Admin on your local box to execute the above steps. Officially it is still a unresolved issue Till Date: https://github.com/docker/for-win/issues/1297. Hope this helps. Share Improve this answer Follow answered Apr 28, 2019 at 16:35 AbdullahAbdullah 48955 silver badges55 bronze badges 1 Worked like a charm. THank you @Abdullah – Sike12 Jan 24, 2020 at 22:26 Add a comment  | 
We recently had our hard drive encrypted and I am unable to use Docker for windows from then. Every time I launch Docker for windows I get the below error, "Current operation failed because Windows policy "Deny write access to fixed drives not protected by Bitlocker" is enabled. Please disable it and retry the operation". Has any one faced this issue and know how to resolve it? Is installing Docker Toolbox the only option? Many Thanks
Launching docker for windows throws "Deny write access to fixed drives not protected by Bitlocker"
You can use Sort dropdown for recently updated gists otherwise, there is no other feature like pin or star yet provided by github.
Is there a way to pin my github gists at the top, Some gist are frequently used and updated. A Pin at the top make it easy to access. Currently I keep a browser bookmark for easy visit.
Is there a way to pin my github gists to keep at the top
There are three cases possible:They deliver a self-signed certificateThey deliver a certificate signed by the root certificate (rare case) which you are assumed to have as trustedThey deliver a certificate signed by CA certificate which they expect you to have (quite common case, as in Windows intermediate CA certificates are stored as well, so you can build a complete chain)Case 1 can be easily checked by you but such certificates are not trusted by default (unless the user has trusted them). In cases 2 and 3 you need to rebuild a chain using local certificate storage as a helper.
I am trying a simple Java code to retrieve certificate chain for remote servers. Some websites return a chain of certificates (2,3,4..) and some just 1. My question is: Is there something wrong when I get certificate chain with length 1?
Can a valid certificate chain length be 1?
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3) | cut -c 2- | cut -c 1-13maybe?ShareFollowansweredAug 17, 2020 at 19:55unsafe_where_trueunsafe_where_true6,1261515 gold badges6262 silver badges119119 bronze badgesAdd a comment|
I would like to tag my release with v as prefix and product type as a suffix. E.g. Initial releasev1.0.0-alpha01-internalorv1.0.0-alpha01-externalNow I am running a GitHub action workflow to publish a release.# The GITHUB_REF tag comes in the format 'refs/tags/xxx'. # So if we split on '/' and take the 3rd value, we can get the release name. run: | NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3) echo "New version: ${NEW_VERSION}"with the above code snippet, I get my new versionv1.0.0-alpha01-internalorv1.0.0-alpha01-externalnow I don't want my version to be the same as TAG so I would like to cut v from start and -internal or -external from the end of the release TAG.The expectation of a new version would be1.0.0-alpha01
format TAG release ref for Github Workflow Action
You pass the cache Hashmap to the other class in a constructor or a setter method.HashMap<Integer,String> cache = new HashMap<Integer,String>(); cache.put(21, "Twenty One"); cache.put(31, "Thirty One"); NewClass newClass = new newClass(cache); or NewClass newClass = new newClass(); newClass.setCache(cache);
Just want to use java hashmap to cache a simple pair into memory and want to get the cached data in another instance.I am using the below code to put some datas into cache consider the below ProcessDefinitionJavaCode.java code.package Folder.ProcessDefinition; import java.util.*; import java.io.*; public class ProcessDefinitionJavaCode{ /****** START SET/GET METHOD, DO NOT MODIFY *****/ protected String string_1 = ""; protected String string_2 = ""; public String getstring_1() { return string_1; } public void setstring_1(String val) { string_1 = val; } public String getstring_2() { return string_2; } public void setstring_2(String val) { string_2 = val; } /****** END SET/GET METHOD, DO NOT MODIFY *****/ public ProcessDefinitionJavaCode() { } public void invoke() throws Exception { /* Available Variables: DO NOT MODIFY In : String string_1 In : String string_2 * Available Variables: DO NOT MODIFY *****/ HashMap<Integer,String> cache = new HashMap<Integer,String>(); cache.put(21, "Twenty One"); cache.put(31, "Thirty One"); } }What should I be doing If I want to get the datas I added just now in cache in another java class temp.java. I am sorry if it is very silly, I am not a Java expert..
Simple caching in Java using hashmap
0 I solved it, and I'm not sure why, but I got it working using port 80 inside the Docker container. The port on my localhost is still 4200, but inside the container, it's 80, so I ran the container like this: docker run -p 4200:80 -d mydhid/project I think I have changed something in the dockerfile too, here's the one I'm using right now if it can be helpful: FROM node:latest as node WORKDIR /app COPY . . RUN npm install RUN npm run build --prod FROM nginx:alpine COPY --from=node /app/dist/front-end-blog-demo /usr/share/nginx/html I tried again running it as 4200:4200, and it's not working. It seems that the Docker port must be mandatory at 80. Share Improve this answer Follow edited Jun 5, 2023 at 20:22 jrran90 6801212 silver badges1818 bronze badges answered Jun 4, 2023 at 13:52 ShadyRasoShadyRaso 3544 bronze badges Add a comment  | 
I tried to dockerize an Angular app.. I tried with two different Dockerfile, because I was not able to run this.. First file I tried: FROM node:latest as node WORKDIR /app COPY . . RUN npm install EXPOSE 4200 RUN npm run build --prod FROM nginx:alpine COPY nginx.conf /etc/nginx/nginx.conf COPY --from=node /app/dist/front-end-blog-demo /usr/share/nginx/html Second file (actual file): FROM node:16-alpine AS build WORKDIR /app COPY package*.json ./ RUN npm install COPY . . RUN npm run build CMD ["npm", "start"] I build it with: docker build -t mydhid/project . pushed it, and ran it with: docker run -p 4200:4200 -d mydhid/project It seems that is listening fine and everything went fine, but when I go to localhost:4200 it doesn't show anything.. This is the port that is actually really listening: This is the docker desktop log: And this is the docker ps command: Everything seems ok, but still (with both dockerfile images) I can't see anything displayed on my localhost:4200.. I tried all that with another port, 3000, but same issue that everything looks fine but not showing anything.. what should I do? Yesterday it was working, today I tried Docker compose to run both Front End and Back End, and from today seems nothing working.. I'm 100% the apps work fine, because when I run it from terminal with: ng serve -o it opens me the localhost:4200 and my login page
Docker with Angular app, can't see anything on my localhost
0 If you need something similar to JavaScript allocations timeline, you can do the exact thing in Safari following these steps Safari DevTools -> Memory tab -> Start Recording JavaScript Allocations Let the application run for a while; then stop the recording and check the timeline for any significant allocations In addition, you can do a couple other checks as described below Safari DevTools -> Memory tab -> Start Recording Heap Allocations After a while, stop the recording and check the timeline for any significant allocations Safari DevTools -> Memory tab -> Record Again, stop the recording after a while, take a snapshot using the Take Heap Snapshot button and then compare multiple snapshots in order to identify objects that aren't being garbage collected. Share Improve this answer Follow answered Jan 11 at 1:08 hex494D49hex494D49 9,16933 gold badges3939 silver badges4848 bronze badges 3 I'm having trouble understanding these instructions. Safari's dev tools don't have a Memory tab. This question was about what Safari reports as its "Page" memory usage, which it lists separately from "JavaScript" memory. – Josh Kelley Jan 11 at 1:20 @JoshKelley I must have a custom version of Safari, just kidding... ;) Safari -> Preferences -> Advanced tab, check the box next to 'Show Develop menu in menu bar'. Then 'right click' on your page -> Inspect Element -> Tmeline -> Memory – hex494D49 Jan 11 at 1:52 Okay. As I mentioned, though, this appears to give JavaScript memory usage, not what Safari calls "Page" memory usage. – Josh Kelley Jan 11 at 2:20 Add a comment  | 
I am trying to debug a large memory leak I am seeing in a webview embedded in a unity app. Unfortunately, I am stuck using safari dev tools. In the dev tools I see that my JS heap is staying steady, around 75mb. However, my "page" memory is growing quickly. Over the course of 10 minutes or so it grew from 272mb to up over 1gb. I don't know how to tell what is taking up all that "page" memory. Is there a way I can see what is building up, similar to the javascript allocations timeline?
How do I debug a buildup in "page" memory in safari dev tools?
Memory is "stomped" when a piece of code manipulates memory without realizing that another piece of code is using that memory in a way that conflicts. There are several common ways memory can be stomped.One is allocating, say, 100 bytes of memory but then storing something past the 100th address. This memory might be used to hold something completely different. This is particularly hard to debug because the problem will appear when something tries to access the victim that was stomped on, and the code that stomped on it may be totally unrelated.Another is accessing memory after it was freed. The memory may be allocated for another object. Again, the code that shows the problem may be related to the newly-allocated object that got the same address and unrelated to the code that caused the problem.
I just cameacross this blog postwhich mentions “stomping memory”:a C++ program which is easily capable of stomping memory (something you probably have never even heard of if you were born in a managed code world.)And in fact I have never heard of it!So, what is this, a memory stomp, stomping memory? When does it occur?
What is a “memory stomp”?
Ah, I didn't realized it was as easy as just usingoutput_dir = docs
I'm confused about the organization of files for a course built usingrmarkdown::render_site()and to be deployed on github asmy_name.github.io/course_nameGithub pages creates the web pages from thedocs/directory, whereasrender_siteplaces them in a_sitedirectory. Will it work if I just use:output_dir = docsin my_site.ymlfile? Or is there a different way to do this?My local project directory looks like this.+-- about.Rmd +-- examples +-- exercises +-- fig +-- footer.html +-- images +-- index.Rmd +-- lectures | +-- lecture1.pdf | +-- lecture1.pptx | +-- lecture1.Rmd | +-- lecture2.pdf | +-- lecture2.pptx | +-- lecture3.pdf | \-- lecture3.pptx ++-- R +-- resources.Rmd +-- styles.css +-- _site +-- _site.yml
How to create github.io pages for a course using rmarkdown::render_site()
Thememory_get_usagefunction directly queries PHP's memory allocator to get this information. It reports how much memory is used by PHP itself, not how much the whole process or even the system as a whole is using.If you do not pass in an additionaltrueargument what you get back is the exact amount of memory that your code uses; this will never be more than whatmemory_get_usage(true)reports.If you do callmemory_get_usage(true)you will get back the size of the heap the allocator has reserved from the system, which includes memory that has not been actually used by your code but is directly available to your code.When your script needs more memory than what is already available to the allocator, the latter will reserve another big chunk from the OS and you will seememory_get_usage(true)jump up sharply whilememory_get_usage()might only increase by a few bytes.The exact strategy the allocator uses to decide when and how much memory to allocate is baked into PHP at compilation time; you would have to edit the source and compile PHP to change this behavior.
I decided to take a look at how much memory was being allocated to a few of my PHP scripts, and found it to be peaking at about 130KiB. Not bad, I thought, considering what was going on in the script.Then, I decided to see what the script started at. I expected something around 32KiB.I got 121952 bytes instead. After that, I tried testing a completely devoid script:<?php echo memory_get_usage();It also started with the same amount of memory allocated.Now, obviously, PHP is going to allocate some memory to the script before it is run, but this seems a bit excessive.However, it doesn't seem to be dynamic at all based on how much memory is available to the system at the time. I tried consuming more system memory by opening other processes, but the pre-allocated memory amount stayed the same exact number of bytes.Is this at all configurable on a per script basis, and how does PHP determine how much it will allocate to each script?Using PHP Version 5.4.7Thanks.
PHP memory_get_usage() on empty PHP script
What doesterminatedpod mean? If you wish to delete finished pods of any jobs in the namespace then you can remove them with a single command:kubectl -n <namespace> delete pods --field-selector=status.phase==SucceededAnother approach in Kubernetes 1.23 onwards is to use Job's TTL controller feature:spec: ttlSecondsAfterFinished: 100In your caseTerminatedstatus means your pods are in a failed state. To remove them just change thestatus.phasetoFailedstate (https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#PodStatus)ShareFolloweditedJul 23, 2022 at 15:20answeredJul 21, 2022 at 21:09SzczadSzczad80777 silver badges1313 bronze badges3never thought about trying a field selector with delete command, but once your see it it seems obvious, thanks @Szczad–Jean-Pascal J.Jul 22, 2022 at 14:04@Szczad I've added a picture of the pods with that are in Terminated STATUS. I tried the command you mentioned and tried it with Terminated status instead of Succeeded, But it didn't work for me.–KaliTheGreatJul 23, 2022 at 7:15That seems like a failure. Check your PODs for the failure reason.–SzczadJul 23, 2022 at 15:14Add a comment|
I know how to delete a specific pod:kubectl -n <namespace> delete pod <pod-name>Is there a way to delete all the Terminated pods once?
How to delete all the Terminated pods of a kubernetes cluster?
There are two possible errorsThe file or directory you are mapping is invalidThe base image you are using do not have /bin/bashand try to start a new container instead of old one from docker run projects
When I typedocker start projectsI get this error:Error response from daemon: invalid header field value "oci runtime error: container_linux.go:247: starting container process caused \"exec: \\"/bin/bash”\\": stat /bin/bash”: no such file or directory\"\n" Error: failed to start containers: projectsWhat should I do so I can start my docker containers?
Error response from daemon when starting a docker container
We'll, after a lot of troubleshooting and hair-pulling sessions, it turns out there's an issue with my workstation.The WCF service is self-hosted in a windows service running under the Local System account. If the service is run under a different user account, all is well. All is also well when run under Local System on all the other machines I tried it on.I Guess I'm about to do a fresh install.ShareFollowansweredJul 5, 2014 at 17:22JoeproJoepro1,1931313 silver badges1515 bronze badgesAdd a comment|
I have a WCF service that exposes two bindings: BasicHttpBinding and NetTcpBinding. Both bindings are secured with a valid Entrust SSL certificate.Everything seems to work fine over HTTP, but am getting certification validation issues over net.tcp.The client is configured to use the 'ChainTrust' certificate validation mode. This is the error thrown by WCF:The certificate that was used has a trust chain that cannot be verified. Replace the certificate or change the certificateValidationMode. A certificate chain could not be built to a trusted root authority.I'm not very familiar with SSL certificates, but I've noticed the certificate was issued by an intermediate certificate. All the certificates in the chain have been installed on the server. On the client, the root CA certificate is trusted but the intermediate certificate is not.If I install the intermediate certificate on the client, all is well. However, this doesn't sound right to me? Shouldn't only the Root certificate be trusted?
WCF nettcpbinding SSL certificate validation issue
5 Seems like there is no solution to do so right now. Here is ticket for rider: https://youtrack.jetbrains.com/issue/RIDER-38942 and for visual studio: https://developercommunity.visualstudio.com/t/allow-running-unit-tests-in-docker/554907 There are some hacks, which you can do to attach debugger to test project, but all of them require some manual interaction and experience is not as seamless as running/debugging the application. Share Improve this answer Follow answered Jun 30, 2021 at 9:06 ShadowShadow 2,27244 gold badges2525 silver badges5151 bronze badges Add a comment  | 
My integration tests have dependency on redis. They have dockerfile included, so everything works in CI. However when running locally from test explorer I have to manually start redis container. Is there possibility for IDE to automatically run/debug tests in docker containers, so when attemptying to run/debug test in IDE (or maybe even using dotnet test) everything runs in docker? Please note, that I want to run/debug tests in docker, not docker in tests.
How to run tests in rider / visual studio in docker container
Your user should work at http level (using curl for example) but if you want to use kibana, add the kibana_user role too. It is required to use kibana.Have a look on the docs aboutbuild in rolesandkibana authorizationfor more details.
I'm having a problem with New User created by Kibana (using user "elastic"). This is the order i did.I'm using ELK for 7.5.1 versionFirst, i enable security inelasticsearch.ymlby addedxpack.security.enabled: trueSecond, atkibana.ymli editelasticsearch.username= "elasctic" andelasticsearch.passwordis my set up passwordI start service elasticsearch and kibana.I sign Kibana link with user "elastic"I create role "test" like the pictureI create user "test001" with role "test" like picture belowI try to login with my new create user but fail.{"statusCode":403,"error":"Forbidden","message":"Forbidden"}So how can I fix it? or somethings i know about user is wrong ? I want to make some authen with the Security function. Thanks!
User create by Kibana can't not sign in {"statusCode":403,"error":"Forbidden","message":"Forbidden"}
Just remove all references to the object, and it will be garbage collected (when the JS engine does some garbage collection).article = undefined; // or some other valueShareFollowansweredOct 19, 2014 at 17:07QuentinQuentin929k129129 gold badges1.2k1.2k silver badges1.4k1.4k bronze badges2It is not guaranteed that a GC cycle will occur.–user1804599Oct 19, 2014 at 17:08I guess I will accept this answer... I think there is no way to delete object with force. Only way to undefine it and let GC.–bodacydoOct 20, 2014 at 2:05Add a comment|
I'm new to JavaScript and come from C++ background. This will sound silly but I can't find how to delete objects created withnewin JavaScript.Here's an example:function Article (id) { this.content = db.get('article', "id:" + id); ... } var article = new Article(5);Every instance of Article allocates memory as it gets data from the database (in my case content of the article). This leads my application to quickly grow to gigabytes in size of memory usage.How do I release memory in JavaScript? I founddeletebut it appears to delete array and hash elements rather than Objects.
How to delete objects created with `new` in JavaScript?
+150You can always activateDirectorySlashfor a specific location:<Location "/en"> DirectorySlash On FallbackResource /index.php </Location>I didn't spend that much time on this issue, but you want to read the warning about it in the link above. Or you can use the alternative solution:RewriteEngine On RewriteCond %{REQUEST_URI} ^/en$ RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L]If problems with relative urls for images etc. try adding the following to your page header:<head> <base href="/" /> <head>Restart apache in order for the changes to take effect. If WordPress is used pay attention to the order of execution.All the redirect rules must be located before routing rules. The WordPress rules route everything to index.php.
quick question regarding my .htaccess fileI want to forwardhttps://myurl.com/entohttps://myurl.com/en/with a trailing slash.This is my try so far.RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.en[^/])$ /$1/ [L,R=301]What am I doing wrong here? Thanks for your help?
htaccess: add trailing slash to specific case only
3 The way I've been able to successfully work with GitHub in a team is to make everything a prefab. To clarify, I looked at my hierarchy top level, and tried to make everything there a separate prefab. e.g. root .Camera Items .Game Manager Items .Level Game Objects By separating areas of concern into separate prefabs, you can modify the prefab, which is saved as an asset, and the actual Scene itself isn't modified. To break it down, if your scene is made up of the three items listed above, then it doesn't matter how much you modify your specific prefabs, the scene is STILL just made up of the three prefabs. The scene doesn't store the prefab details, just a reference to the prefab. So, Person A can be working on the Game Manager prefab, and Person B can be working on the Level Game Objects prefab, and when it comes time to commit, the scene itself hasn't changed. The one point is that the prefab overrides ARE saved in the scene, so, to make things easier, we simply made sure our prefabs were completely saved before committing. It's not easy to get into the swing of it, but when you do, it's workable. Not great, but workable. Share Improve this answer Follow answered Jan 7, 2021 at 3:45 Milan Egon VotrubecMilan Egon Votrubec 3,85222 gold badges1010 silver badges2424 bronze badges Add a comment  | 
So my team has been running into a problem with GitHub and Unity. Whenever we try to merge branches our scene gets screwed up, everything in the scene gets deleted and overall it causes problems. Were trying to look for a better way to do this. Does anyone who has experience working in big teams know how to solve this? Like a workflow or process of moving work into the main branch that can solve this problem? Anything will help!
Unity and Github Scene Merging
You'll want to set the path in which the cookie is available when you're sending it to the client. For example, onexample.com/place1, set the cookie like this:setcookie($name, $value, 0, '/place1/');That way, the cookie will only be available insideexample.com/place1/*.
I have setted some cookies inexample.com/place1. When I iterate over$_COOKIE... it displays all cookies for my domain. Even those that are setted inexample.com/place2. Is it possible to display cookies that are setted only inexample.com/place1/*?
How to Display Cookies?
How can I get the website to use https protocol?Yes, you can, but not from AWS ACM. The SSL certificates fromACM can onlybe used on:Elastic Load BalancingAmazon CloudFrontAmazon API GatewayFor home server, you have to get a SSL certificate from a third party. A popular choice ishttps://letsencrypt.org/which offers free public SSL certificates. But to register an SSL cert, you will need a DNS domain for your home server.
I have a domain name bought from AWS, and can get SSl certificate from AWS ACM. I could install the certificates to Load Balancer for EC2. Now I am hosting a server at home, either a NodeJS app or Python Flask app. How can I get the website to use https protocol?
Install AWS SSL Certificate to home server
You need to create appropriate IAM policy (such as AWSLambdaKinesisExecutionRole tailored to specific stream that you want to share). Create IAM role of type Another AWS Account where you need to specify account ID of the account with which you want to share your stream, and attach the above mentioned IAM policy to that role. Go to the other account and create new IAM policy such as this. { "Version": "2012-10-17", "Statement": { "Effect": "Allow", "Action": "sts:AssumeRole", "Resource": "arn:aws:iam::THE-SOURCE-ACCOUNT:role/UpdateApp" } } Where resource is the ARN of the role created in the source account. (THE-SOURCE-ACCOUNT is that account's ID). Attach this policy to the user that needs that cross-account access to Kinesis stream. Now that user should have access to the stream if they assume the new role.
I have one kinesis stream created in my account, I need to provide access to another user who is there in another root account. I did not find any way to add a policy for the stream, so How to provide access to another user in a different account? How the user is another account can access the Kinesis stream?
AWS enable access to kinesis stream for different account
Do I have to "push" something after I make a tag? Yes: git push --tags (since GitHub releases are based on git tags)
So... I have a Git repository on my desktop computer that is linked to a GitHub repository. When I do: git tag -a -F C:\Users\Adam\AppData\Local\Temp\git-tag-message-4665532737910125701.txt v0.1 63f5 the tag doesn't show up as a release on the GitHub website. (Note: An IDE handles all of the Git->GitHub stuff for me) Do I have to "push" something after I make a tag?
Git tags don't show up as GitHub releases
12 There is no native support for bucket last modified time. The way I do it is to use aws cli , sort the output, take the bottom line and print the first 2 fields. $ aws s3 ls mybucket --recursive | sort | tail -n 1 | cut -d ' ' -f1,2 2016-03-18 22:46:48 Share Improve this answer Follow answered Mar 18, 2016 at 23:26 helloVhelloV 51.2k77 gold badges139139 silver badges148148 bronze badges Add a comment  | 
Does S3 bucket has information in regard to when is the last time it has been updated? How can I find the last time any of the objects in the bucket were updated?
How to check when is the last time S3 bucket has been updated?
Make sure you are starting Cygwin with Administrator privileges. Right click on your Cygwin shortcut, then 'Run as Administrator'.
I am trying to set-up cron on my CYGWIN installation on a Win7 box. I am using the procedure mentiond here:How do you run a crontab in Cygwin on Windows?This is how I try to start the cron-service:> cygrunsrv -I cron -p /usr/sbin/cron -a -DThe response that I get is:cygrunsrv: Error installing a service: OpenSCMManager: Win 32 error 5: Access deniedAny tips on how to proceed?
cygwin: Starting cron as a service (access denied)
The#is getting encoded as%23. Try using theNEflag in your rule:RewriteRule ^([0-9]+)/([0-9]+)$ /api/web/index.html#$1/$2 [R=301,NC,L,NE]theNEflag tells mod_rewrite not to encode the URI.
By using the following .htaccessRewriteEngine On RewriteRule ^([0-9]+)/([0-9]+)$ /api/web/index.html#$1/$2 [R=301,NC,L]When user types the following URL at their browser.http://localhost:8080/1/2I'm expecting, Apache will perform internal redirection, and change the displayed URL at browser too (through R=301).http://localhost:8080/api/web/index.html#1/2Changing the displayed URL at browser is important. This is to ensureindex.html's JavaScript can parse the url correctly.However, what I really get ishttp://localhost:8082/api/web/index.html%231/2I will get Apache error.Apache false thought that, I wish to fetch a file named2located in directoryapi/web/index.html%231/Is there anything I can solve this through modifying.htaccessonly?
hashtag in apache .htaccess
I had a similar error when trying to get Filebeat to read/parse my log-file which was in the Common Log Format. The solution for me was that the Filebeat-configuration (filebeat.yml) needed to have input type set to "log" (instead of "container" in my case) as in the following example:filebeat.inputs: - type: log scan_frequency: 1s paths: - '/pathto/log/*.log'ShareFollowansweredNov 7, 2022 at 13:21Martin HedmarkMartin Hedmark544 bronze badgesAdd a comment|
I have created a demonset of filebeat on azure kubernetes to collect the logs and ingest on Graylog but seems like there is an parsing error related to parsing which am not able to figure out. Kindly help me out.I got the code fromhttps://github.com/elastic/beats/tree/master/deploy/kubernetes/filebeatBelow is the error:2021-06-07T06:47:18.903431005Z2021-06-07T06:47:18.903Z ERROR [reader_docker_json] readjson/docker_json.go:204 Parse line error: parsing CRI timestamp: parsing time "2021/06/07" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "/06/07" as "-" 2021-06-07T06:47:18.903462505Z2021-06-07T06:47:18.903Z ERROR [reader_docker_json] readjson/docker_json.go:204 Parse line error: parsing CRI timestamp: parsing time "2021/06/07" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "/06/07" as "-" 2021-06-07T06:47:18.903469505Z2021-06-07T06:47:18.903Z ERROR [reader_docker_json] readjson/docker_json.go:204 Parse line error: parsing CRI timestamp: parsing time "2021/06/07" as "2006-01-02T15:04:05.999999999Z07:00": cannot parse "/06/07" as "-"
Error while parsing the container logs using Filebeat
the problem has been solved. I just updated devtools and remotes package.ShareFollowansweredDec 14, 2020 at 12:25Zhisheng JiangZhisheng Jiang7111 silver badge88 bronze badgesAdd a comment|
R devtools::install_github("jzsbioinfo/APRD") Error in utils::download.file(url, path, method = method, quiet = quiet, : Can not open URL'https://api.github.com/repos/jzsbioinfo/APRD/tarball/master'My session info:─ Session info ──────────────────────────────────────────────────────────────────────────── setting value version R version 3.6.2 (2019-12-12) os Windows 10 x64 system x86_64, mingw32 ui RStudio language (EN)Methods I have tried but doesn't work:options(download.file.method = "libcurl") devtools::install_github("jzsbioinfo/APRD")oroptions(download.file.method = "wininet") devtools::install_github("jzsbioinfo/APRD")I also tried to check the Use TLS 1.2 box in the internet opinions, but doesn't work.
R devtools::install_github("jzsbioinfo/APRD") Error in utils::download.file(url, path, method = method, quiet = quiet,
Solved mine by doing the following:mkdir -pv $(brew --prefix)/etc/echo 'address=/.dev/127.0.0.1' > $(brew --prefix)/etc/dnsmasq.confsudo cp -v $(brew --prefix dnsmasq)/homebrew.mxcl.dnsmasq.plist /Library/LaunchDaemonssudo launchctl load -w /Library/LaunchDaemons/homebrew.mxcl.dnsmasq.plistsudo mkdir -v /etc/resolversudo bash -c 'echo "nameserver 127.0.0.1" > /etc/resolver/dev'If your development domains are not.dev, then change the bolded parts to your domain. If you need other domains, you need to only repeat steps 2 and 6.Source:Thisbrilliant blog post by Alan Ivey.
I have been using dnsmasq on mac osx mountain lion which was installed via mac ports. Recently,I upgraded to Osx Mavericks and all of a sudden it has stopped working.I examined the dnsmasq.conf and resolv.conf in /opt/local/etc/ which are unchanged. In addition the dnsmasq process is displayed running in the os activity monitor. I tried a force quit of the dnsmasq process as well.Any suggestions? Has anyone experienced a similar problem?
osx Mavericks: dnsmasq stops working
You can usemod_rewritefor this.RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule !^index\.html$ index.html [L,R=410]This rule will rewrite requests to non-existing files toindex.htmland send the 410 status code along with the response. But this requires Apache 2 asR=4xxis only available since Apache 2.
We have a client that is closing its doors. We want to redirect all traffic that goes to their domain to a new page index.html with a few images in the _img subdirectory. (The page explains what happened, what current customers can expect with their current orders, etc.)I've read about possibly using HTTP 410 Gone as the best way to technically explain to bots, etc. that the site is not there, isn't coming back and isn't providing a forwarding address. What would be the best way to do this in an .htaccess file, and direct users to the new index.html?
.htaccess to Redirect All Traffic to One Page (410 Gone)
Yes, you can control this with themax-podsoption to the Kubelet, either via a command line flag or Kubelet config file option. But beware that we don't test as much outside the normal scaling targets so you might be able to break things.
I've deployed Kubernetes cluster on my local machine.The default allocatable pods in Kubernetes are 110. I want to increase the number of pods per node in my cluster.Can anyone let me know if it's possible ? If yes, how can we do it?
Can we increase number of pods per node in Kubernetes?
There is nothing immediately planned (3-4 years) around ADO retirement. This is emphasize by the recognition there are more mature tools in Azure DevOps around Project Management and event some features which have no immediate counterparts in GitHub. Azure Test Plans is the prime example if you are using manual test cases there is no planned alternative on GitHub's roadmap. The focus has been on integration between GitHub and Azure DevOps. There have been recent announcements that support this. Items such as Advance Security for GitHub coming to ADO and the ability to connect GitHub to Azure DevOps Orgs. ADO Public roadmap I am seeing more and more where organizations host their source code in GitHub to take advantage of newer features such as codespaces and the recent announcement of Co-Pilot X. Then Azure DevOps can read the GitHub repository and then the organization can decide if they want to use ADO Pipelines or GitHub Actions. Both are supported. The tasks, project management, and test cases would still live in Azure DevOps. The reoccurring message I am hearing is if you are a startup or brand new should evaluate GitHub first; however, Azure DevOps is a valid option as most major organizations, including Microsoft, are still heavily invested in the product. Thus there is a focus on integration between the two products and it's more of an AND then a VS conversation.
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 10 months ago. Improve this question Is it better to host code on Github or in the DevOps code platform? We have some specific repositories hosted on an enterprise Github. Others in the DevOps version control within a DevOps project. A question came up about a new repo and I am wondering pros and cons of putting it in one vs the other? I personally prefer the Github interface but wondering if we will hit some limitations with pipelines if we put it in there. Did I also read somewhere that Microsoft is ultimately planning to decommission DevOps version control and so that would be a factor in the long term? (I couldn't find a Microsoft article about this)
Github vs Azure DevOps Version Control [closed]
The standard doesn't say (it doesn't know about "stack", "heap" etc). But in practice the answer is: Neither. The string literal will be stored in the data section, usually in a read-only page. As a side note, as Als mentions in the comments, it's undefined behavior to attempt to modify a string literal.
For the C statement given below i would like to know where the memmory allocation will take place. char* ptr="Hello";//ptr is a automatic variable then the pointer variable ptr will be allocated on the stack,but where will this string "Hello" be allocated. Is it on Stack or on Heap? And what about memory allocation for initialization statement like char ptr[]="Hello";
Where will the memory allocation for a string in C will take place
Defining constants for string literals (and, sometimes, primitive literals) isn't always helpful.In this case, it's hard to know what I would call the constant so that it is meaningful and more readable; and you presumably would be encouraged to do the same for both parameters:class_name.replaceAll(TWO_OR_MORE_SPACES_PATTERN, ONE_SPACE_REPLACEMENT).trim()Is thatreallybetter? I'd say not.If the problem is that you're using the same replace/trim logic in lots of places, define a method instead:static String replaceSpacesAndStrip(String className) { return className.replaceAll("\\s{2,}", " ").trim(); }and then invoke:class_name = replaceSpacesAndStrip(class_name);
I need to remove the extra spaces from the string I am getting from JSP. Before calling the setter method, I am using the below to remove the spaces:class_name=class_name.replaceAll("\\s{2,}", " ").trim();Sonar scan is giving me smell stating define a constant instead of using the literal. How to put the content in replaceAll parameter in a constant? And use that constant as a parameter.Sonar scan result :- Define a constant instead of using this "\s{2,}" literal 8 times.
Need to define a constant for the string literal[SonarQube Smell]
To redirect specific pages tohttps:RewriteEngine On RewriteBase / # specific pages to https RewriteCond %{HTTPS} off RewriteCond %{THE_REQUEST} /(login|register|forgotPassword) [NC] RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # all other pages to http RewriteCond %{HTTPS} on RewriteCond %{THE_REQUEST} !/(login|register|forgotPassword) [NC] RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]
This may have been asked before but I can't find an answer.I have recently purchased an SSL certificate and I need help setting up the.htaccessfile.I am using the MVC design pattern so every page goes though index.phpThis is my current .htaccess configuration and all pages go through httpsRewriteEngine On RewriteBase / RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^(.+)$ index.php?url=$1 [QSA,L]I have read that using https on the whole site adds overheads. Would it be possible to add rules for specific pages such as login/register/forgot password that would redirect to https instead of http?
.htaccess redirecting from http to https
From thesource code, it looks like you can access it by_valueattribute:c._value.get() == 2.6ShareFollowansweredJun 11, 2020 at 19:40ywbaekywbaek2,99133 gold badges1010 silver badges2828 bronze badgesAdd a comment|
From the prometheus python documentation, let's say I run this:from prometheus_client import Counter c = Counter('my_failures', 'Description of counter') c.inc() # Increment by 1 c.inc(1.6) # Increment by given valueHow might I get the value of thecmetric after performing both of these increments? This is for testing purposes, I want to be able to testc.value == 2.6Except I can't seem to find a value accessor.Is this even possible, or should I find another way?
Prometheus Python see current value of metric
You can connect Nginx to your Go program directly via proxy_pass. Given: package main import ( "fmt" "net/http" ) func handler(w http.ResponseWriter, r *http.Request) { fmt.Fprintf(w, "Hi there, I love %s!", r.URL.Path[1:]) } func main() { http.HandleFunc("/", handler) http.ListenAndServe(":8080", nil) } You just need to add to your nginx configuration the proxy_pass: location @go { proxy_pass 127.0.0.1:8080; }
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered. Closed 8 years ago. Improve this question I have a simple go program that uses http.ListenAndServe to serve content. I use nginx to serve multiple applications on one server, and I want to use it for the go program too. I've tried looking for information on it, but all I found people using FastCGI or node.js to get it to work. Is it possible to do it with just pure Go and nginx? I understand how to use nginx with a subdomain, but not a Go program.
How do I use nginx with Go for a subdomain? [closed]
I know that this thread has been answered, but I have tried a library that has worked great. I was using ASIHttpRequest before and the difference is big. https://github.com/rs/SDWebImage Also, if someone needs to Resize or Crop the remote images, and have the same features that SDWebImage provide, I have integrated SDWebImage library with UIImage+Resize library (by Trevor Harmon), and created an example project. I modified the code of SDWebImage to deal with transformations (crop, resize). The project is public on https://github.com/toptierlabs/ImageCacheResize. Feel free to use it!
I want an image loading and caching library for iOS that loads images asynchronously, caches images, with a configurable cache size and LRU behaviour, checks to see if images have been updated, using HTTP HEAD, doesn't cache anything in the event of an error code or an invalid image. I've looked at HJCache, but it only satisfies the first two of these criteria. Is there something better?
iOS - Caching and loading images asynchronously
You must use a single quality profile to analyze all projects within your solution. Indeed, only a single quality profile is used during a SonarQube analysis. In theory, you could create two quality profiles in SonarQube, and run two SonarQube analysis (one for example on all product code, and another one on all test code), but this requires some manual setup on your side.Regarding custom rules, they are supported: You need to create them in SonarQube web interface from the "Template for custom FxCop rules" rule template, and then enable the newly created custom rules in your quality profile.
I have a question regarding FXCop analysis using SonarQube with the MSBuild-Runner. I have realized that the MSBuild-Runner loads a rules file from the server which matches the quality profile in Sonar and uses that file for the FXCop run.In our project we have a solution with several projects. For each project a rules file is configured depending on its type e.g. product or test code. We also use custom rules in own FXCop assemblies.How can I configure MSBuild-Runner so that he uses the rules file which is configured in the project file? How can I add our custom rules into Sonar? Can I import our rules files somehow?Thanks for your help!
SonarQube MSBuild-Runner use custom FXCop rules from project file
From my perspective, more clean way is to use different path/FQDN for each type of backend and manage all of them by any ingress controller. At least it will able your developers to access the new version without customization of requests.But, if you want to use a header as a feature flag and manage routing based on it, then yes, contentbased routing in Istiowill be OK, I think.
I would like to set up an infrastructure that enables easy experimentation in the production environment for developers in my team.For example, let's assume that I have a HTML page that lists purchases for on online retail shop. The production version is implemented using React, but we would like to test out some alternative implementations, for example one written in Vue.js, and the other one that is not JS based and instead uses backend rendering.In this scenario, I would like to flip a feature flag for all the developers who are working on the Vue.js implementation to see the Vue.js page, and for the backend rendering team to see their implementation.In Kubernetes, each implementation would be a different pod/replication set/service.What is the best pattern to implement the above routing scheme in Kubernetes? IsIstio based intelligent HTTP header based routinga good candidate for this task?
Best way to achieve feature flag based routing in Kubernetes
1 Like this document here: https://www.codeproject.com/Articles/1191288/Debug-multiple-NET-Core-projects-concurrently-runn we can debug multiple projects at the same time in Visual Studio 17 running on docker container. Share Improve this answer Follow edited Sep 17, 2020 at 6:28 Pang 9,733146146 gold badges8282 silver badges123123 bronze badges answered Sep 21, 2017 at 8:10 Jack ZhaiJack Zhai 6,31811 gold badge1212 silver badges2020 bronze badges 1 Your comment seems to say the opposite of the codeproject site. The site says you are able to debug both projects using the single docker-compose startup project, not multiple startup projects. I haven't tested this to know what's the case. – playsted Sep 28, 2017 at 15:13 Add a comment  | 
I've got a solution that contains two dockerized web projects. I've got my docker-compose file setup to deploy both of those projects. Both of those projects are set (in their respective projects), to launch a browser when they are debugged. When I hit F5 to debug, it consistently starts a web browser pointing at one of those two projects, but not the other. Nor is the one that it's picking the one we'd generally prefer to have launched. Is there a way to control how many and which projects launch browser windows when debugging a docker solution containing multiple containers?
Debugging Multiple Web Docker Containers in Visual Studio 2017+
2 Do not use an unbounded queue. I cannot tell you what the bound should be; your load tests should give you an answer to that question. Anyhow, make the bound configurable: at least dynamycalliy configurable, better yet adaptable to some load measurement. You did not tell us how the clients submit their requests, but if HTTP is involved, there already is a status code for the overloaded case: 503 Service Unavailable. Share Improve this answer Follow edited Oct 7, 2021 at 6:06 CommunityBot 111 silver badge answered Nov 8, 2011 at 22:26 forty-twoforty-two 12.5k22 gold badges2626 silver badges3737 bronze badges 1 thx edited my question to include tcp protocol. Do you have a suggestion on how to dynamically resize the capacity of the queue? Also, how should the client react during the unavailability of the server? – beefyhalo Nov 8, 2011 at 22:32 Add a comment  | 
Brief I am running a multithreaded tcp server that uses a fixed thread pool with an unbounded Runnable queue. The clients dispatch the runnables to the pool. In my stress test scenario, 600 clients attempt to login to the server and immediately broadcast messages to every other client simultaneously and repeatedly to no end and without sleeping (Right now the clients just discard the incoming messages). Using a quad-core with 1GB reserved for heap memory - and a parallel GC for both the young and old generations - the server crashes with a OOM exception after 20 minutes. Monitoring the garbage collector reveals that the tenured generation is slowly increasing, and a full GC only frees up a small fraction of memory. A snapshot of a full heap shows that the old generation is almost completely occupied by Runnables (and their outgoing references). It seems the worker threads are not able to finish executing the Runnables faster than the clients are able to queue them for execution (For each incoming "event" to the server, the server will create 599 runnables as there are 600 - 1 clients - assuming they are all logged in at the time). Question Can someone please help me conceive a strategy on how to handle the overwhelmed thread pool workers? Also If I bound the queue, what policy should I implement to handle rejected execution? If I increase the size of the heap, wouldn't that only prolong the OOM exception? A calculation can be made to measure the amount of work done in the aggregation of Runnables. Perhaps this measurement be used as a basis for a locking mechanism to coordinate clients' dispatching work? What reaction should the client experience when the server is overwhelmed with work?
Thread Pool Workers Overwhelmed With Runnables Crashing the JVM
1 The basic idea is that we follow these steps: Create a new empty repository App or whatever Make an initial commit because we need one before we do a merge. Add a remote to old repository OldA. Merge OldA/master to New/master. Make a subdirectory OldA Move all files into subdirectory OldA. Commit all of the file moves. Repeat 3-6 for OldB. Share Improve this answer Follow answered Dec 25, 2019 at 21:47 ameramer 1,59511 gold badge1414 silver badges2222 bronze badges 3 how do I Merge OldA/master to New/master? – MD10 Dec 25, 2019 at 22:15 @MD10 Inside of New/master do .. 'git merge OldA' – amer Dec 25, 2019 at 22:17 I created the new folder and added the server origin- then did git merge server/master but it says merge: server/master - not something we can merge – MD10 Dec 25, 2019 at 22:17 Add a comment  | 
I have 2 git repositories with 2 different urls clientApp and serverApp I want to have 1 project repository for this called App that consists of those .. How do I do that in github? something similar to group projects in gitlab..
How to combine 2 git repositories into one project
Rails 5.1# config/initializers/active_record_logger.rb class CacheFreeLogger < ActiveSupport::Logger def add(severity, message = nil, progname = nil, &block) return true if progname&.include? "CACHE" super end end ActiveRecord::Base.logger = CacheFreeLogger.new(STDOUT)
I'm trying to disable logging of caching in production. Have succeeded in getting SQL to stop logging queries, but no luck with caching log entries. Example line in production log:CACHE (0.0ms) SELECT `merchants`.* FROM `merchants` WHERE `merchants`.`id` = 1 LIMIT 1I do not want to disable all logging, since I want logger.debug statements to show up in the production log. Using rails 3.2.1 with Mysql and Apache. Any suggestions?
How to disable activerecord cache logging in rails
The GPU is a separate core you can only interact with via MMIO; it's not a coprocessor like x87 originally was (wherefmulran on a separate chip). You can access it the same way the graphics drivers do.There is no CPU instruction that does stuff on the GPU directly because it's not tightly-coupledat all, hence the high latency being a problem for GPGPU. Sending work to the GPU looks like storing to memory and then passing a pointer to that physical memory to the GPU, e.g. viamov [mem], raxor something to the address of one of the GPU's MMIO registers.For Intel, those are open source if you really want to dive in to Linux DRM (direct rendering manager) and X11 drivers that talk to the GPU after asking the kernel for access.
My oldish PC has an Intel HD 420 in it.I was wondering - we can use Assembly code to address the CPU directly, with commands likemul,addetc.How can I pass on Assembly calculation commands to a graphics chip such as the Intel HD, or say the "gpu part" of AMD's Ryzen? Is it the same mechanics as for an ARM graphics chip?(No tags for apu, onboard-graphics, intel-hd, ryzen)Edit: I understand that OpenCL is the correct approach, and that an on-board chip is as good as any other peripheral hardware (eg printer) as far as communication. However, out of theoretical curiosity, looking for the simplest Assembly snippet, that does any sort of mundane calculation on an onboard graphics chip like an Intel HD XXX.
What is the most direct way of addressing a graphics chip?
According toMicrosoft KB article 832017monitoring performance counters remotely uses the NetBIOS Session Service protocol on port 139. I doubt that you will be able to map this protocol to another port as it is used by several Windows components.You could write your own tooling around performance monitoring that uses ports and protocols available to you, but compared to firing up performance monitor and connecting to a remote system it requires much more effort.
We have a distributed test environment and have some firewall challanges, so we cannot use the usual ports to acquire performance counter metrics. Anyone know if it is possible to reconfigure which ports the performance counters can be read from. E.g. configure them to use port 8080 or similar instead of 139/445?We have a Visual Studio Load Test which needs to read the metrics.
Configure Performance Counters to use different ports?
You are duplicating server configuration. Simply keep one server properties set : server { listen 80; root /var/www/html/Web/dist; location /api/ { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } } That means : listens to all request for all ip's on port 80 Evaluate relative path from root /var/www/html/Web/dist; if there's a matching '/api/' in url pass it to localhost:3000 It should work as expected now
I have been searching for this answer for months and have never been able to resolve this. I am using nginx as my web server and using node.js for my backend apis and vue as my main front end webpage that uses webpack. I would like to be able to go to my Vue page by going to http://ip and then get access to the api services by going to http://ip/api. I dont have a domain name set up so I use IP address for the urls. So far I built my Vue app and is sitting in the /var/www/html/Web/dist folder and it works if you go to the http://ip url but I can not access my node.js APIs. My node.js server is running on localhost port 3000. My nginx config looks like this: server { listen 80; root /var/www/html/Web/dist; } server { listen 80; location /api/ { proxy_pass http://localhost:3000; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; } }
Configure nginx for both Vue app front end and node.js backend
It's unclear what you mean by "pod to speed up only when..." but if you mean that you want to have your app deployed, but scaled down to0 replicas, and only scale up ton replicaswhen there is traffic to the service, thenKnative Servingis an option.
Let's say I have deployed a full stack application in my minikube cluster(with frontend and several backend APIs), and I want the authentication api pod to scale from 0 replica to n only when I clicked "login" in the frontend UI, is it possible to achieve this through service discovery? If so, how? Thanks!
Trigger the deployment of an api through frontend UI
After a lucky find in further research (http://answerpot.com/showthread.php?577619-Several%20Bugs/Page2) I found something that helped...Supplying theuwsgi_pass_request_body off;parameter in the Nginx conf resolves this problem...
I have a django app hosted via Nginx and uWsgi. In a certain very simple request, I get different behaviour for GET and POST, which should not be the case.The uWsgi daemon log:[pid: 32454|app: 0|req: 5/17] 127.0.0.1 () {36 vars in 636 bytes} [Tue Oct 19 11:18:36 2010] POST /buy/76d4f520ae82e1dfd35564aed64a885b/a_2/10/ => generated 80 bytes in 3 msecs (HTTP/1.0 440) 1 headers in 76 bytes (0 async switches on async core 0) [pid: 32455|app: 0|req: 5/18] 127.0.0.1 () {32 vars in 521 bytes} [Tue Oct 19 11:18:50 2010] GET /buy/76d4f520ae82e1dfd35564aed64a885b/a_2/10/ => generated 80 bytes in 3 msecs (HTTP/1.0 440) 1 headers in 76 bytes (0 async switches on async core 0)The Nginx accesslog:127.0.0.1 - - [19/Oct/2010:18:18:36 +0200] "POST /buy/76d4f520ae82e1dfd35564aed64a885b/a_2/10/ HTTP/1.0" 440 0 "-" "curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15" 127.0.0.1 - - [19/Oct/2010:18:18:50 +0200] "GET /buy/76d4f520ae82e1dfd35564aed64a885b/a_2/10/ HTTP/1.0" 440 80 "-" "curl/7.19.5 (i486-pc-linux-gnu) libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15"The Nginx errorlog:2010/10/19 18:18:36 [error] 4615#0: *5 readv() failed (104: Connection reset by peer) while reading upstream, client: 127.0.0.1, server: localhost, request: "POST /buy/76d4f520ae82e1dfd35564aed64a885b/a_2/10/ HTTP/1.0", upstream: "uwsgi://unix:sock/uwsgi.sock:", host: "localhost:9201"In essence, Nginx somewhere loses the response if I use POST, not so if I use GET.Anybody knows something about that?
Nginx connection reset, response from uWsgi lost
3 Your observation is absolutely true, If you are using Fargate Launch type, its mandatory to give Task Size because for Fargate pricing calculation is based on Task Size and in case if application tries to consume more resource(CPU or Memory) than specified its size, they are killed and you'll exit code as 137, which seems logical. This situation can be addressed in two ways: Benchmark application against load and set appropriate Task Size. If load is unpredictable, use service autoscaling based on service CPU Utilization and Application Load Balancer in front of Fargate service, this will scale out your service under load conditions and will scale in when there is no CPU utilization. I hope this will help in stabilizing your micro application. Share Improve this answer Follow answered May 10, 2019 at 14:58 MangalMangal 62744 silver badges99 bronze badges 1 Also be aware that a memory limit is mandatory but it won't tell you. I accidentally left it out and it killed my process after only 128MB RAM used, but left the container running forever! – bparker Jun 11, 2019 at 1:10 Add a comment  | 
I have setup a ecs task with one container using fargate. The task and container have cpu and memory limits set. I can see that my container will shutdown occasionally for some unknown reason. At the time of shutdown and restart the max cpu is 100% and the minimum 0%. I am trying to workout if the container shuts down due to my application hitting some limit internally or AWS shutting it down when the CPU hits 100%. I know memory is a hard limit which triggers a shutdown but I don't know if CPU is the same way? thanks in advance!
Does AWS ECS fargate shutdown container if CPU reaches 100%?
You can click on the "Refresh" icon of the "Violations" view to force the update:http://docs.codehaus.org/display/SONAR/Browsing+SonarQube+in+Eclipse+-+Prior+to+version+3.2#BrowsingSonarQubeinEclipse-Priortoversion32-ViolationsViewdisplayslocalorremoteinformationdependingontheselectedmode
I have a multi-module maven project I code on using Eclipse, with the Sonar plugin installed. When I do a commit, Jenkins starts a build that invokes Sonar. The Sonar server is then up to date. However, the violations in Eclipse are not up to date. I know about local analysis, but that be cumbersome to do for each module, plus the server already ran an update, I just need to find a way to have Eclipse refresh the violations from the server. The modules are associated with Sonar and the server just fine. Is this possible to refresh the violations or should I be doing something differently (to work around this)?
Refreshing Sonar violations in Eclipse
GitHub serves "raw" pages withCache-Control: max-age=300. That's specified in seconds, meaning the pages are intended to be cached for 5 minutes.You can see this if you open the Developer Tools in your web browser of choice before clicking the "Raw" button on GitHub.ShareFollowansweredApr 10, 2019 at 14:33John ZwinckJohn Zwinck244k3939 gold badges328328 silver badges443443 bronze badgesAdd a comment|
Updated: Seem it has about 5 minutes to update raw. I will close my question at here.I have a problem with Github.I want to get the file asrawformat.I add new commit and my file is updated.Look like this:I addJUSTkeyword in variabletech.When I clickraw. It keeps the previous version.Look like this:Have any method to getrawversion of the file was commit.
Github not update `raw` after commit
As answered onHow to query AWS to get ELB names and attached instances to that using python boto3 modules?:The Application Load Balancer has multipleTarget Groups. Ports on instances are registered to a Target Group.The only command that seems to list instances in a Target Group isdescribe_target_health(), which returns theinstanceandport(because one instance can serve multiple targets):{ 'TargetHealthDescriptions': [ { 'Target': { 'Id': 'i-0f76fade', 'Port': 80, }, 'TargetHealth': { 'Description': 'Given target group is not configured to receive traffic from ELB', 'Reason': 'Target.NotInUse', 'State': 'unused', }, }, { 'HealthCheckPort': '80', 'Target': { 'Id': 'i-0f76fade', 'Port': 80, }, 'TargetHealth': { 'State': 'healthy', }, }, ], 'ResponseMetadata': { '...': '...', }, }
I have a couple of Elastic Load Balancers. I wish to dynamically find the public IP addresses associated with the EC2 Instances which belong to the ELB's Target Group. I used to be able to do it with the previous version of ELB, because the Instance ID's would be listed with each ELB. Now, it seems, they are not. Any clues would be great!
Find EC2 Instances belonging to specific Target Group with Boto3
2 Disclaimer: This answer is not based on any documentation but only on my interpretation of these constants. I assume that the page size is correctly reported. I assume the allocation granularity refers to the granularity of the OS memory allocation interface. There are these two cases to consider: the allocation granularity is greater than the page size. Allocating a memory block of the size of a page would then lead to an actually larger allocation of resources, thus it should be prevented. the allocation granularity is less than the page size. Allocating a memory block of the size of the allocation granularity would still lead to a whole page being allocated/mapped, thus it should be prevented. Basically both cases would cause the OS to allocate more memory than requested. By using the maximum this can be avoided, such that the (user space) allocation code can be (relatively) certain about its actual memory usage. Share Follow answered Sep 12, 2016 at 19:23 Daniel JourDaniel Jour 16k22 gold badges3737 silver badges6363 bronze badges 1 2 Your reasoning is pretty correct. Documentation (msdn.microsoft.com/en-us/library/windows/desktop/…) for the SYSTEM_INFO data structure tells that dwPageSize is the page size and the granularity of page protection and commitment. This is the page size used by the VirtualAlloc function. Then dwAllocationGranularity is the granularity for the starting address at which virtual memory can be allocated. My doubt is if this two values are kind of rigidly system defined or more flexible and customizable. – fitzbutz Sep 12, 2016 at 20:16 Add a comment  | 
I’m reading the Google’s TCMalloc source code (the Windows porting). int getpagesize() { static int pagesize = 0; if (pagesize == 0) { SYSTEM_INFO system_info; GetSystemInfo(&system_info); pagesize = std::max(system_info.dwPageSize, system_info.dwAllocationGranularity); } return pagesize; } As you can se in the code snippet above pagesize(that is the unit of allocation) is calculated as the max between dwPageSize and dwAllocationGranularity. What I mean to know is the kind of relationship between these two values: is it necessary to calculate the value in the way here upside explicated? And are there any situations in which dwPageSize could be greater than dwAllocationGranularity?
Relationship between dwPageSize and dwAllocationGranularity
There's no concept of a "current" registry - full image tags always contain the registry address, but if no registry is specified then the Docker Hub is used as the default.Sodocker push user/apppushes to Docker Hub. If you want to push it to a local registry you need to explicitly tag it with the registry address:docker tag user/app localhost:5000/user/app docker push localhost:5000/user/appIf your local registry is secured, you need to rundocker login localhost:5000butthat does not change the default registry. If you push or pull images without a registry address in the tag, Docker will always use the Hub.This issueexplains the rationale.
In docker, how can one display the current registry info you are currently logged in? I installed docker, if I now do docker push, where does it send my images?I spend over 30min searching this info from Google and docker docs, and couldn't find it, so I think it deserves its own question.
Docker show current registry
As per the latest release notes, For Kibana 8.XX version they have enabled authentication and TLS by default. For me I already had elasticsearch installed which is serving on http port so we have to enable TLS in elasticsearch first. As the Kibana-elasticseach communication must be tls enabled as per latest kibana release.For testing purpose(we are not working on Production anyways ) we are okay with accessing kibana using port-forward too so i have installed 7.XX version helm chart and moved ahead.https://github.com/elastic/helm-charts/blob/7.17/kibana/README.mdIf you want to enable tls for ES, kibana i found below link helpful.https://github.com/elastic/helm-charts/tree/main/kibana/examples/security(this example is from kibana GIT repo itself)https://www.lisenet.com/2022/deploy-elasticsearch-and-kibana-on-kubernetes-with-helm/https://thomasdecaux.medium.com/setup-https-tls-for-kibana-with-helm-cert-manager-io-fd1a326085fe
I am not able to install Kibana with simple helm command which used to work earlier."helm install kibana elastic/kibana -n kibana"Are there any recent changes in kibana helm? Do we need to create elasticseach-master-certs and elasticsearch-credentials secrets prior to kibana install now.https://artifacthub.io/packages/helm/elastic/kibana
Kibana helm install error with MountVolume.SetUp failed for volume "elasticsearch-certs" : secret "elasticsearch-master-certs" not found
Update project action in IntelliJ wants the current branch to have a configured tracked remote counterpart and fails if there is no such. So to make it work you can set a tracking from the command line withgit branch --set-upstream-to origin/mastercommand.Noteorigin/master, not a simplemaster- this should be a reference to a remote branch. Using such reference is only possible when there is a remote defined in git-config. IntelliJ can help with setting remotes, checkVCS - Git - Remotes...As a side note, you can use the Share on GitHub action in IntelliJ to push new projects to GitHub - the action will automatically create a new repo and push the code.ShareFollowansweredJul 1, 2020 at 23:32Dmitrii SmirnovDmitrii Smirnov7,21511 gold badge2020 silver badges2929 bronze badges2"The requested upstream branch origin/master does not exist" when I try to use the git branch command. I will try the Share on GitHub action...–Umbrella_ProgrammerJul 2, 2020 at 2:21Do you have the origin remote set? Try callinggit fetch–Dmitrii SmirnovJul 2, 2020 at 9:24Add a comment|
I am a very Junior engineer. I'm trying to push a new project to GitHub. I created a GitHub account and a repository named TeamBuilder. When I try to push the project to GitHub via Git/IntelliJ, I get the following error:So, when I try to do a pull/merge or a pull/branch default, I get this error:I've read through a few SO posts, includingthis oneandthis one, but I'm not sure I understand the command lines, even after reading about them in the Git help documentation.When I try to set the upstream branch to master, I get this error:Warning: Not setting branch master as its own upstream.How can I successfully push this project to my GitHub repo? I'd like some help on this before I continue down the rabbit hole and break something.
IntelliJ + git failing to push: "Not setting branch master as its own upstream"
http://api.jquery.com/jQuery.ajax/ when you use ajax to call up the data source you can tell it whether or not to cache the data source.
I'm using a remote XML source. Can someone point me in the right direction to cache this document? Thanks
jQuery ui autocomplete cache xml source
Here is the answer: (Note that it doesn't work with YAML file. Only JSON.) // spec: content, window.swaggerUi = new SwaggerUi({ url: 'https://api.github.com/repos/me/my_repo/contents/api.json', authorizations: { 'Accept': new window.SwaggerClient.ApiKeyAuthorization("Accept", "application/vnd.github.v3.raw", "header"), 'Authorization': new window.SwaggerClient.ApiKeyAuthorization("Authorization", "token 0123456789", "header"), }, dom_id: "swagger-ui-container", supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'], onComplete: function(swaggerApi, swaggerUi){ if(typeof initOAuth == "function") { initOAuth({ clientId: "your-client-id", clientSecret: "your-client-secret-if-required", realm: "your-realms", appName: "your-app-name", scopeSeparator: ",", additionalQueryStringParams: {} }); } if(window.SwaggerTranslator) { window.SwaggerTranslator.translate(); } }, onFailure: function(data) { log("Unable to Load SwaggerUI : ", data); }, docExpansion: "none", jsonEditor: false, defaultModelRendering: 'schema', showRequestHeaders: false, });
I want to host on a private website the documentation of my swagger API using swagger-ui. The YAML file is hosted on a private GitHub repository. According the this gist, I successfully retrieved the desired file with the curl command line but I'm stuck trying it with swagger-ui: window.swaggerUi = new SwaggerUi({ url: 'https://api.github.com/repos/me/my_repo/contents/api.yaml', authorizations: { 'Authorization': 'token 0123456789', 'Accept': 'application/vnd.github.v3.raw' }, dom_id: "swagger-ui-container", supportedSubmitMethods: ['get', 'post', 'put', 'delete', 'patch'], onComplete: function(swaggerApi, swaggerUi){ if(typeof initOAuth == "function") { initOAuth({ clientId: "your-client-id", clientSecret: "your-client-secret-if-required", realm: "your-realms", appName: "your-app-name", scopeSeparator: ",", additionalQueryStringParams: {} }); } if(window.SwaggerTranslator) { window.SwaggerTranslator.translate(); } }, onFailure: function(data) { log("Unable to Load SwaggerUI"); }, docExpansion: "none", jsonEditor: false, defaultModelRendering: 'schema', showRequestHeaders: false }); window.swaggerUi.load(); I get an error: http.js:296 Uncaught TypeError: auth.apply is not a function Any suggestions?
How to load a file hosted in a private GitHub repository on Swagger-UI
I have a similar issue. In my case I just had the branch:gh-pages(e.g. repo.github.io);git branch -> * gh-pagesWell what worked for me was tocreate the branch:master;git branch master -> git branch -> gh-pages, * master git push origin master(in fact I think it's a trick)Just confirm that there isNO CNAME fileingh-pagesand mainly in themasterbranch.https://github.com/username/repo.github.io/blob/master/CNAME -> 404 https://github.com/username/repo.github.io/blob/gh-pages/CNAME -> 404You can test whether you are still redirecting throughcURLoronline;e.g. http://redirectcheck.com/index.phpI hope this works for you too.
I have a Namecheap domain and it issomedomain.example. I accidentally changed thesomedomain.example/blog/which was in blog repository toblog.somedomain.example. Now even if I remove myCNAMErecord and remove the custom URL from the settings in the GitHub page setting, mysomedomain.example/blog/is still getting redirected toblog.somedomain.example.Is there any way to remove this redirection and use it the default way as it was?P.S There is no CNAME now in my gh-pages repository.
How do I remove GitHub pages sub-domain redirection?
You're almost there. The link that you've provided address your issue directly:If your function also requires internet access (for example, to reach a public AWS service endpoint), your function must use a NAT gateway or instanceYou're missing this:Your VPC should contain a NAT gateway or instance in a public subnet.This means that without a NAT, your Lambdas won't be able to access the internet - even though "they are" in a public subnet. This is how lambda fundamentally works in VPCs.The exact samelinkthat you provided instructs you on how to create this NAT Gateway alongside your VPCs and Lambdas.Complementing the answer - onwhy you would need a NAT Gatewayin this scenario - is due to:... you can use a network address translation (NAT) gateway to enable instances in aprivate subnetto connect to the internet or other AWS services, but prevent the internet from initiating a connection with those instances...Extracted fromaws docsKeep in mind:If you need your lambdas to accessonly the internet- and not any other resource in the same VPC - I recommend to make them non-VPC and then they'll have internet access out of the box - and you won't pay for the cost of NATs.
I have a lambda function that simply does anhttp.gettohttp://www.google.com. If I don't have the function behind a VPC, it works fine. The trouble happens when I put it in my VPC.I know you need to set up an Internet Gateway. I did this. My two subnets are attached to route tables that route0.0.0.0/0to this Internet Gateway. Shouldn't that be all I need?The function still hangs regardless of the Internet Gateway's association. The subnet's security groups allows All Traffic out of0.0.0.0/0".According toGrant Internet Access to a VPC Lambda Functionthat is everything I should need to do.Edit:Adding full list of VPC components to be clear.Created a new VPC (vpc-09*)Created a new subnet (subnet-05*) point to my new:route table, (rtb-0b). I see subnet-05* under Subnet Associations. Under Routes, I see Destination 0.0.0.0/0 linked to the Target ofa new NAT Gateway (nat-08*). This NAT Gateway has an Elastic IP Address and a Private IP Address. It resides in the correct Subnet. The status is Available.Additionally, I created a new Security Group for the Lambda function. This contains one Outbound Rules for "All traffic" with Destination 0.0.0.0/0As far as I can tell, I've done absolutely everything in that AWS Documentation link to provide my Lambda with internet access. Yet, it still hangs forever when trying to make a request to the outside internet.
AWS Lambda Function in VPC With Internet Gateway Still Can't access Internet
The problem is with this setting:OTEL_EXPORTER_OTLP_ENDPOINT=http://0.0.0.0:4318Imagine your pod as a stripped out host itself. Localhost or 0.0.0.0 of your pod, and you don't have a collector deployed in your pod.You need to use the address from your collector. I've checked the examples available at theshared repoand foragent-and-standaloneandstandalone-onlyyou also have a k8s resource of type Service.With that you can use the full service name (with namespace) to configure your environment variable.Also, the Environment variable now is calledOTEL_EXPORTER_OTLP_TRACES_ENDPOINT, so you will need something like this:OTEL_EXPORTER_OTLP_TRACES_ENDPOINT=<service-name>.<namespace>.svc.cluster.local:<service-port>
I am using the opentelemetry-ruby otlp exporter for auto instrumentation:https://github.com/open-telemetry/opentelemetry-ruby/tree/main/exporter/otlpThe otel collector was installed as a daemonset:https://github.com/open-telemetry/opentelemetry-helm-charts/tree/main/charts/opentelemetry-collectorI am trying to get the OpenTelemetry collector to collect traces from the Rails application. Both are running in the same cluster, but in different namespaces.We have enabled auto-instrumentation in the app, but the rails logs are currently showing these errors:E, [2022-04-05T22:37:47.838197 #6] ERROR -- : OpenTelemetry error: Unable to export 499 spansI set the following env variables within the app:OTEL_LOG_LEVEL=debug OTEL_EXPORTER_OTLP_ENDPOINT=http://0.0.0.0:4318I can't confirm that the application can communicate with the collector pods on this port. Curling this address from the rails/ruby app returns "Connection Refused". However I am able to curlhttp://<OTEL_POD_IP>:4318which returns 404 page not found.From inside a pod:# curl http://localhost:4318/ curl: (7) Failed to connect to localhost port 4318: Connection refused # curl http://10.1.0.66:4318/ 404 page not foundThis helm chart created a daemonset but there is no service running. Is there some setting I need to enable to get this to work?I confirmed that otel-collector is running on every node in the cluster and the daemonset has HostPort set to 4318.
Unable to export traces to OpenTelemetry Collector on Kubernetes
Double check the url request parametersValidate your tokensCheck for rate limitsShareFollowansweredFeb 15 at 8:25Ravin BandaraRavin Bandara2422 bronze badges1Have tried all of that–SaifFeb 15 at 8:36Add a comment|
I'm encountering a problem while trying to exchange a code for a token using the GitHub OAuth API. Whenever I make a request to the URLhttps://github.com/login/oauth/access_token, I receive a 404 {"error":"Not Found"} error in response.What I've Tried:I've attempted to resolve this issue using various approaches, including:Making a cURL call.Utilizing the new Octokit() constructor with createOAuthUserAuth().Relevant Information:Octokit version: 3.1.2Example of the cURL call:$ curl -X POST \ -H "Content-Type: application/x-www-form-urlencoded" \ -H "User-Agent: axios/0.21.1" \ -H "Accept: application/json" \ -d "client_id=XXXXXX" \ -d "client_secret=XXXXXXX" \ -d "grant_type=authorization_code" \ -d "code=XXXXXX" \ -d "redirect_uri=https://example.com" \ https://github.com/login/oauth/access_token {"error":"Not Found"}
Encountering 404 Error 'Not Found' When Exchanging Code for Token using GitHub OAuth API
Since GitHub is using linguist to detect languages, you can open a PR to report some files incorrectly tagged as "Smalltalk". For instance, issue 2012 is still active (even though it is closed).
I have a personal repository on GitHub that is completely written in C#, with a few XML configuration files, and some PowerShell files from included NuGet packages. On the main repository page, GitHub shows a colored bar to display the breakdown of different languages used in the repository. If you click this bar, it shows the language names and actual percents. This particular language breakdown seems a bit odd to me, since I am the only contributor, and I have never used Smalltalk. If you click a language name, it will show you a list of the files using that language. In this last image, you can see on the left side that the repository really only contains C#, XML, PowerShell, text and markdown files. So why does GitHub think I'm using Smalltalk? And why doesn't the color bar mention that I'm using XML?
Github shows 4% of repository is in a language that is not used in repository
The URL stated in the error-message ismissingthegithub.comdomain. If you have trouble furthermore try:touch initial git add initial git commit -m "initial commit"and thengit push -u origin masterMake sure you have the required access rights. I strongly recommend working with ssh-key's.ShareFollowansweredMar 9, 2019 at 22:26JonathanJonathan1,97155 gold badges3030 silver badges5353 bronze badgesAdd a comment|
I run thisGitcommand:git remote add origin https://github.com/vgonzalezfranchi/my-first-blog.gitBut then when I try:git push -u origin masterI get the following error:fatal unable to access "https://vgonzalezfranchi/my-first-blog.git/": Could not resolve host: vgonzalezfranchiCould you help me to solve this problem?
Github push notification could not resolve host
I have created a docker file for this exact purpose: FROM php:7.3-apache ENV ACCEPT_EULA=Y RUN apt-get update && apt-get install -y gnupg2 RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add - RUN curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-release.list RUN apt-get update RUN ACCEPT_EULA=Y apt-get -y --no-install-recommends install msodbcsql17 unixodbc-dev RUN pecl install sqlsrv RUN pecl install pdo_sqlsrv RUN docker-php-ext-enable sqlsrv pdo_sqlsrv COPY . /var/www/html/ Enjoy!
I have a simple docker file, as follows: FROM php:7.2-apache COPY src/ /var/www/html/ Normally to install drivers for Mongo or MySQL connectivity I would do so by adding something like the below to the dockerfile: docker-php-ext-install mongo On this occasion I want to connect my php application to a SQL Server database, and I understand the best way to do this for php 7.x is by using the PDO driver, however I am unfamiliar with how to do configure this in the dockerfile. I've tried doing a pecl install, like adding: RUN pecl install sqlsrv pdo_sqlsrv However this fails with a combination of errors that do not seem to point me in the right direction. I'm just looking for a simple way to get this done in a dockerfile or by using docker run. For added info, here's the error I'm getting: /tmp/pear/temp/sqlsrv/shared/xplat.h:30:17: fatal error: sql.h: No such file or directory #include <sql.h> ^ compilation terminated. Makefile:194: recipe for target 'conn.lo' failed make: *** [conn.lo] Error 1 ERROR: `make' failed The command '/bin/sh -c pecl install sqlsrv pdo_sqlsrv && docker-php-ext-enable pdo_sqlsrv' returned a non-zero code: 1 Thanks all
Install / Configure SQL Server PDO driver for PHP docker image
Theproxy_next_upstreamdirective is a configuration directive to control re-request from a group ofupstream serversby aproxy_passif request to one of them fails. It doesn't make sense withoutproxy_passand anupstreamblock defined. You may use it if you proxy to multiple upstream servers like this:upstream backends { server 192.2.0.1; server 192.2.0.2; ... } server { ... location / { proxy_pass http://backends; proxy_next_upstream error timeout http_404; } }If you want nginx to search for a file on disk, and if it's not found - proxy request to another server, configure it e.g. usingtry_filesfallback instead:location / { root /path/to/root; try_files $uri @fallback; } location @fallback { proxy_pass http://... }Seehttp://nginx.org/r/try_filesfor more info about thetry_filesdirective.
I want nginx to search my local host for the file first and on a 404 error it should search server 1.1.1.1.I am able to fetch the file that is located on local host, but not able to get from server 1.1.1.1.server { listen 80; server_name localhost; access_log /var/log/nginx/access.log main; location /products/ { proxy_next_upstream http_404; root /var/foo; } } server { listen 80; server_name 1.1.1.1; location /products/ { ######### } }I guess proxy_next_upstream is not switching to the server.Any help on this would be appreciated.
Nginx proxy_next_upstream doesn't work
Just reset your branch to the upstream version: git reset --merge origin/dev This will discard all 5 of your changes. Then push the result to your fork: git push -f fork Note that you must use -f, otherwise your push will fail, because normally the server does not allow to discard commits.
I have made a change to my fork that was a mistake so now i want to reset my fork to that of the origin. Note change was already pushed to GitHub. C:\Development\IdentiyServer\IdentityServer4>git remote -v fork https://github.com/XXXXX/IdentityServer4.git (fetch) fork https://github.com/XXXXX/IdentityServer4.git (push) origin https://github.com/IdentityServer/IdentityServer4.git (fetch) origin https://github.com/IdentityServer/IdentityServer4.git (push) As you can see I have two remotes set up origin is the main repo and fork is the fork on my GitHub account which i have access to push to. I have to do pull requests from my fork to send them over to the main repo. I did a pull on the main project to be sure it was to date C:\Development\IdentiyServer\IdentityServer4>git pull origin dev From https://github.com/IdentityServer/IdentityServer4 * branch dev -> FETCH_HEAD Already up to date. I did the same on my fork C:\Development\IdentiyServer\IdentityServer4>git pull fork dev From https://github.com/XXXXX/IdentityServer4 * branch dev -> FETCH_HEAD Already up to date. I did a checkout on the dev branch C:\Development\IdentiyServer\IdentityServer4>git checkout dev Already on 'dev' Your branch is ahead of 'origin/dev' by 5 commits. (use "git push" to publish your local commits) Which clearly shows that there are changes in my fork/dev that are not in origin/dev good these are the ones I want to remove. I need to dump this change and get my fork back to the state of the origin. reading this syncing-a-fork So i figured i should just merge in the origin/dev branch C:\Development\IdentiyServer\IdentityServer4>git merge origin/dev Already up to date. I check the file and i can see that it hasn't been reset yet, and git checkout dev is still saying that its ahead of the origin. I am thinking that somehow i need to roll back the last change but I am not sure how to do that.
Remove change from fork and sync to origin
6 rails 4.1 can't deploy via capistrano 3 Looks like not enough RAM on the server. I just increased my RAM from 512MB to 1GB and I've passed this 137 error Share Improve this answer Follow edited May 23, 2017 at 12:25 CommunityBot 111 silver badge answered Jun 6, 2015 at 11:38 iamthingiamthing 14122 silver badges77 bronze badges Add a comment  | 
I am getting following error while deploying to server. DEBUG[50057f85] Command: cd /home/deploy/my_project/releases/20140901110633 && ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 ~/.rbenv/bin/rbenv exec bundle install --binstubs /home/deploy/my_project/shared/bin --path /home/deploy/my_project/shared/bundle --without development test --deployment --quiet ) DEBUG[50057f85] bash: line 1: 5953 Killed ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 RBENV_ROOT=~/.rbenv RBENV_VERSION=2.1.2 ~/.rbenv/bin/rbenv exec bundle install --binstubs /home/deploy/my_project/shared/bin --path /home/deploy/my_project/shared/bundle --without development test --deployment --quiet ) cap aborted! SSHKit::Runner::ExecuteError: Exception while executing on host xxx.xxx.xxx.xxx: bundle exit status: 137 bundle stdout: Nothing written bundle stderr: Nothing written SSHKit::Command::Failed: bundle exit status: 137 bundle stdout: Nothing written bundle stderr: Nothing written Tasks: TOP => deploy:updated => bundler:install (See full trace by running task with --trace) The deploy has failed with an error: #<SSHKit::Runner::ExecuteError: Exception while executing on host 107.170.240.115: bundle exit status: 137 bundle stdout: Nothing written bundle stderr: Nothing written Quick help needed!!
Error while deploying to Unicorn server with capistrano 3
Its pretty simple , you can use redis cli monitor command to check the get/set are happening or notredis-cli monitorAnd try to run the application .. if u able to see the keys then redis cache is runningu can also check the redis key by following commandredis-cliThen enter followingkeys *I hope its useful.
I am trying to useredisin my application but I am not sure if my app is usingredisorfiledriver as I can't createtagsbut I can create normalkeysfine.I have setCACHE_DRIVER=redisand also in mycache.phpI have:'default' => env('CACHE_DRIVER', 'redis'),also in my database.php there is:'redis' => [ 'client' => 'predis', 'default' => [ 'host' => env('REDIS_HOST', '127.0.0.1'), 'password' => env('REDIS_PASSWORD', null), 'port' => env('REDIS_PORT', 6379), 'database' => 0, ], ],The reasons for my suspicion are I cannot createtagsand runningredis-cli flushallunderhomestead(ssh)does not seem to get rid of the cahce. I had to use Cache::flush() in laravel instead.So How can I effectively find out which cache driver my application is using?
laravel | How to confirm which caching driver is being used?
Open the Docker settings from the icon on the taskbar:Go to 'Shared Drives' and enable your local drive to be made accessible to your containers:Now you can add folders from your shared drive as a volume in a container. Using thenginxexample from the Dockergetting started guide:docker run -it -v c:/Users:/data nginx /bin/bashThat will give you shell access, where you can find your local files (c:/Users) in the /data directory of your nginx container.
Looking for a quick solution to copy local files to a Docker container on Windows. I wasn't able to find this in other Stack Overflow solutions.You might call this mounting a local drive on Windows within a docker container.
How to copy files from Windows host to Docker container
As you are using EKS withPrometheus, the best source of knowledge is AWS documentation.Do i need prometheus adaptor for registering custom metrics API?Yes, you need at leastPrometheusandPrometheus Adapter.Prometheus:scrapes pods and stores metricsPrometheus metrics adapter:queriesPrometheusand exposes metrics for the Kubernetes custom metrics APIMetrics server:collects pods CPU and memory usage and exposes metrics for the Kubernetes resource metrics APIWithoutCustom MetricsorExternal Metrics, you can only use metrics based onCPUorMemory.InAutoscaling Amazon EKS services based on custom Prometheus metrics using CloudWatch Container Insightsarticle, it's stated:The custom metrics gathered by Prometheus can be exposed to the autoscaler using aPrometheus Adapteras outlined in the blog post titledAutoscaling EKS on Fargate with custom metrics.InAutoscaling EKS on Fargate with custom metricsblog you also find some examples ofautoscaling based on CPU usage,autoscaling based on App Mesh trafficorautoscaling based on HTTP trafficAdditional documentationControl plane metrics with PrometheusWhy can't I collect metrics from containers, pods, or nodes using Metrics Server in Amazon EKS?Install the CloudWatch agent with Prometheus metrics collection on Amazon EKS and Kubernetes clusters
We are planning to Kubernetes horizontal pod scheduler and for that need to install Custom Metrics API. Can someone please tell different ways to install Custom Metrics API on kubernetes cluster?
Custom Metrics API service install for kubernetes cluster