Response stringlengths 15 2k | Instruction stringlengths 37 2k | Prompt stringlengths 14 160 |
|---|---|---|
Documentation says nothing about content type for sending parameters. I assume they do not support JSON as an input.
You may try 'x-www-form-urlencoded' form instead.curl -u user:password --data 'name=dummy_token_name&type=GLOBAL_ANALYSIS_TOKEN' -H 'Content-Type: application/x-www-form-urlencoded' http://localhost:900... | I'm encountering an issue while attempting to generate aGLOBAL_ANALYSIS_TOKENusing the SonarQube API. I'd appreciate any assistance or insights you can offer.Setup and ConfigurationSonarQube Version:Enterprise Edition Version 9.9.1 (build 69595)Endpoint:https://quality-analysis.my-company.io/sonar/api/user_tokens/gener... | Issue Generating GLOBAL_ANALYSIS_TOKEN via SonarQube API - 'name' Parameter Missing |
There are a number of patterns to solve this common problem. You need to choose based on your exact situation and depending on which factor has more weight in your case (performance, correctness, fail-tolerance, misfires allowed or not, etc). The two solution-groups are:The "Quartz" way: you can use aJDBCStorefrom the ... | I have a jvm process that wakes a thread every X minutes.If a condition is true -> it starts a job (JobA).Another jvm process does almost the same but if the condition is true -it throws a message to a message broker which triggers the job in another server (JobB).Now, to avoid SPOF problem I want to add another instan... | Java - How can I ensure I run a single instance of a process in a clustered environment |
The error is telling that git-rebase expects only one referente, not two. And origin is not a reference.
You forgot the slash between origin and master.
git rebase -i origin/master
origin is the name of the repository.
master is the branch of the repository.
You can have several branches. Then the slash is telling ... |
I am working on a Ruby project with a friend who has "collaborator" privileges in my Github.
He issued a pull request from his branch (separate from the master).
I merged his pull request into the master branch.
I then issued the command on the command line git rebase -i origin
master.
The git rebase -i origin mast... | git rebase -i origin master "fatal: Needed a single revision invalid upstream origin" |
Your log files (of the web server) e.g./var/log/nginx/access.logwith thenginxweb server will tell you who it was. Look for the change date/time of theassets.phpfile. Then check server access logs for IP addresses from that exact time. Then search logs for that IP address. You will find the first accesses by that IP ad... | I've got a site that has been hacked for the fourth time now this month. With scripts hosted onautofaucet.org. (sloppy code even, found their names. Some Russian dudes. But that's off topic) I've taken some measurements to prevent a new hack, but alas...I've installed a clean WP installation on the server, with clean f... | WP site keeps getting hacked for a cryptojacker - How to find the leak? |
1
You are using the wrong path.
Change the link tag to this:
<link rel="stylesheet" href="../css/style.css">
And the image tag to this:
<img src="../images/image.png" class="avatar">
This is based on the info you provided about the folder structure. Change as needed
... |
I created a portfolio using github pages but the images and the css in the site won't load.
<link rel="stylesheet" href="../css/style.css">
<img src="../avatar/avatarmakercolor.png" class="avatar">
This how folders are organised
docs
index.html
avatar
avatarmakercolor.png
css
style.css
... | images won't display and css doesnt work in GitHub pages |
1
GPUs are only helpful if you are using code that takes advantage of GPU-accelerated libraries (e.g. TensorFlow, PyTorch, etc.) mostly for training deep learning models. scikit-learn, which you're using here, doesn't support GPUs (and it probably won't). Unless you want to... |
I have a training dataset of shape (120k+, 14) and I'm trying to use GridSearch for Random Forest with 2500 trees.
Just wondering why my Kaggle notebook never uses the GPU even when CPU usage is over 100%???
Do I have to import something or add some code to start the GPU?
| Kaggle kernel is not using GPU |
You can go with thisparm_name = "age"
value = 33
d = {param_name: value}
foo(**d)We can create dictionary with param nam as strings and there value and when we call **d its called unpacking so this will transform to param_name=value while calling the function.ShareFollowansweredMay 7, 2022 at 11:18Deepak TripathiDeepa... | Thank you for your time reading this question.I want to use an existing function through a PIPELINE. I want to give the name of the parameter into that pipeline as well as its value.How can I pass the name of the parameter into a that function?Like:parm_name = "age"
value = 33
foo (parm_name=value)instead we do:params... | Pass parameter name to a function in python |
You can use this code in yourDOCUMENT_ROOT/.htaccessfile:RewriteEngine On
RewriteBase /
RewriteCond %{DOCUMENT_ROOT}/$1 !-d
RewriteRule ^([^/]+)/index\.php$ store.php [L,NC] | I am updating urls of a project and have this old url:http://www.example.com/phones/index.phpThis folder phones doesnt exists anymore but I want to catch the old traffic and when someone visits this url I want .htaccess file to load file store.php which is located in the root directory
How can I do this with htaccess f... | .htaccess to load specific index file when url not exist |
In your Keycloak yaml file you need to add the fieldextraEnvVarsand set theKEYCLOAK_EXTRA_ARGSenvironment variable as shown in the example below:keycloak:
enabled: true
auth:
adminUser: admin
adminPassword: secret
extraEnvVars:
- name: KEYCLOAK_EXTRA_ARGS
value: -Dkeycloak.profile.feature.upload... | Given below is my command to install bitnami keycloak on my kubernetes clusterhelm install kc --set auth.adminPassword=admin,auth.adminUser=admin,service.httpPort=8180 bitnami/keycloak -n my-namespaceI want to import realms(contains users,groups,clients and roles) into my keycloak but before i do that i need to enable ... | how to pass -Dkeycloak.profile.feature.upload_scripts=enabled flag While installing bitnami/keycloak helm charts |
TheSUM()functions sums up values per datapoint. On your last datapoints you have the value 2 for Completed and no value for Failed, so the sum is 2 + 0 = 2. Number widget on the other hand displays the last value returned which for Failed count is 3, but that 3 didn't happen at the last observed time period, it happene... | I have created two metrics (m1 and m2) on my logs which will give me sum of some filter pattern, I wanted to add math expression in metric to sum these two metrics so I have added SUM([m1,m2]) but it is not giving me actual sum, Please refer below snapshot.I tried to add expressions as m1+m2 but still no luck. One thin... | Math Expression on AWS Cloudwatch metrics is not giving expected output |
I use a variation of a method suggested by Mark Jaquith in hisWordPress Skeletonsetup .The idea of this is that by adding the following to the top of your wp-config.php file:if ( file_exists( dirname( __FILE__ ) . '/local-config.php' ) ) {
include( dirname( __FILE__ ) . '/local-config.php' );
define( 'WP_LOCA... | I like to develop locally on localhost, then push everything to a testing server. Both localhost and my testing server are using the same database. The only problem is get_template_directory() returns my testing server path.Can I use .htacess or something else to return the corresponding local/live path from get_te... | Wordpress get_template_directory() working on localhost and dev server with same database |
What your reporting is most likely being caused by the process heap. There are two pieces to a memory allocation in Windows. The first piece is the continuous address space in your application for the memory to accessed through. On a 32 bit system not running the /3GB switch all your allocations must come out of the... | I'm trying to get a better understanding of how Windows, 32-bit, calculates the virtual bytes for a program. I am under the impression that Virtual Bytes (VB) are the measure of how much of the user address space is being used, while the Private Bytes (PB) are the measure of actual committed and reserved memory on the ... | How can a program have a high virtual byte count while the private bytes are relatively low on Windows 32-bit? |
cron tasks does not have any awareness from each other, so you need to check manualy if your task is still working or idle.one way for checking this, write the status to a file. (task1_status.txt)in the beginning of the task, check that status by reading task1_status.txtif status = idle thenupdate status = workingconti... | I'm adding a new minutely cron task as follows:library(cronR)
cron_datamultiple <- cron_rscript("multiple_data.R")
cron_add(command = cron_datamultiple, frequency = 'minutely', id = 'test1', description = 'My process 1', tags = c('test1'), ask=FALSE)If the task takes more than 1 minute, another task starts so the tasks... | cronR minutely task overlapping? |
You can use theblackbox_exporterto probe for connectivity of port 80/443 (http/https) or port 22 (ssh) depending on what runs on your host and then alert onprobe_success == 0. | What approach are folks using to see if a machine is up/down as opposed to the node_exporter up/down (which could be down for other reasons) ?ping?ssh port check?thanks | Best practice for machine up monitor using prometheus? |
TRemotable provides lifetime management via its DataContext property, so the SOAP runtime will free the object itself. As long as the data-context object exists, everything it allocated will exist, too. If you want to claim ownership of and responsibility for an object, simply clear its DataContext property. (That's p... |
Newbie question: I have a forms application. It has a separate thread which makes a web services call, and then posts the results of the call to the main form.
In my thread, after X seconds have passed (using a TTimer), I call:
procedure TPollingThread.OnTimer(Sender: TObject);
var
SystemProbeValues : TCWProbeValues... | Should I free a Delphi object auto-instantiated from a web services call? |
I guess you are probably using an incorrect kubernetes resource .Jobis a immutable Pod that runs to completion , you cannot update it . As per Kubernetes documentation ..Say Job old is already running. You want existing Pods to keep running, but you want the rest of the Pods it creates to use a different pod template a... | I'm working on the manifest of a kubernetesjob.apiVersion: batch/v1
kind: Job
metadata:
name: hello-job
spec:
template:
spec:
containers:
- name: hello
image: hello-image:latestI then apply the manifest usingkubectl apply -f <deployment.yaml>and the job runs without any issue.The problem com... | Changing image of kubernetes job |
This should do it for you, placed in your root.htaccessfile, and replacing your current rule:RewriteEngine on
RewriteRule ^en/.*(?<=/)downloads?$ https://mydomain.jp/en/download.html [R=301,L]
RewriteRule (?:/|^)downloads?$ https://mydomain.jp/jp/download.html [R=301,L]The second rule will not run if the first is match... | My server log shows that visitors to my site often type common keywords that result in 404's, and I would like to redirect some of those keywords to meaningful pages in my site.My.htaccessfile currently contains the following:RewriteEngine On
RewriteRule ^download.*$ https://mydomain.jp/jp/download.html [R=301,L,QSA]So... | Keyword redirect from any subdirectory using RewriteRule |
You can use the argument list ofgroup_leftto include extra labels from the right operand (parentheses and indents for clarity):(
max(consul_health_service_status{status="critical"})
by (service_name,status,node) == 1
)
+ on(service_name,node) group_left(env)
(
0 * consul_service_tags
)The important part here... | I am using theconsul exporterto ingest the health and status of my services into Prometheus. I'd like to fire alerts when the status of services and nodes in Consul is critical and then use tags extracted from Consul when routing those alerts.I understand fromthis discussionthat service tags are likely to be exported a... | How can I 'join' two metrics in a Prometheus query? |
1
There is no such feature in Guava, as Louis already pointed out.
For example you can use EHCache or cache2k. For cache2k I can give you quick directions since this is a core feature we use regularly:
You can either implement the interface ValueWithExpiryTime on your value... |
I am trying to create a cache using guava cache library. One my main requirement is that I want to set the cache expiry after the CacheLoader.load(..) function instead of something most of the examples I encountered on the web, like the one below.
LoadingCache<String, MyClass> myCache =
CacheBuilder.newBuilder().maxi... | Guava cache: how to set expiration on 'CacheLoader.load()' instead of during CacheBuilder.newBuilder()? |
If the argument for applying migrations at deployment time is so that you don't have to remember to do it manually, then I would definitely go with option #1. By making a custom tool, you can also check if the developer forgot to make a migration, and refuse to deploy.With option 2, you could forget to add the SQL migr... | I would like to upgrade my databases at deployment time. As I can see I have two choices:Write a tool that calls theMigrate()method as described inhttps://www.thereformedprogrammer.net/handling-entity-framework-core-database-migrations-in-production-part-2/#1b-calling-context-database-migrate-via-a-console-app-or-admin... | How can dotnet ef migrations script produce a script per migration? |
You should interpret "Local Path" as a reference to the working directory in the virtual machine.
It took me awhile to figure it out. You can see this in the cloning step. You will see something like this.
Cloning into '/home/rof/src/bitbucket.org/<your_user>/<you_repository>'
The path /home/rof/src/bitbucket.org/<you... |
I have a question maybe a little silly, I'm trying to deploy a static site with codeship but I can't understand the documentation:
https://codeship.com/documentation/continuous-deployment/deployment-to-aws-codedeploy/
Currently it's a little different the way to setup, I don't know what to write in "Local Path" input
... | How to deploy to AWS S3 from Codeship? |
44
Do this:
git merge --abort
git pull (to be sure you're up-to-date)
Now replace the contents of the README.md file with what you want it to say. If you don't want it at all, do git rm README.md
Then if you replaced the contents, commit and push those contents with:
git ... |
I am using git version 1.7.11.msysgit.0
I created a repository under GitHUB and added a file called as README.md with some text content .
Later on , I have installed GIT Client , did a clone to get the server contents on to my machine .
Then I deleted the file README.md on to my local machine .
Now when I do git commi... | Merging Issues with Git |
It's because with final /RewriteCond %{REQUEST_FILENAME} !-dTest if the directory exist, and don't do rewrite.
You can delete this condition.ShareFollowansweredNov 9, 2014 at 22:32CroisesCroises18.6k44 gold badges3232 silver badges4848 bronze badges11Thanks. I deleted one .php file in the root directory and it worked. ... | I have added into htaccess file some rules in order to remove index.php from the url in Code Igniter . However, for just one address it is not workingthe url is like this "http://example.com/subtitle/eveythingelse/";so when the second uri is "subtitle" or "sub" it doesn't send to "index.php" and directly reads the fold... | Mode Rewrite is not working for one address |
Sitecore includes the current language in the cache key, among other things, so every sublayout or rendering is treated as a different version in each language. So apply caching to different language versions should be no problem. | I have a basic understanding of how Sitecore caching works including how all the different variations work.But I am not how Sitecore handles languages during caching. Is each language version of a page treated as a different data source and is varybydata the answer then? If not, how can I safely apply caching to differ... | Sitecore caching and languages |
2
Disclaimer: I don't know how it's done with Github so I recommended
gulp
What is gulp?
Gulp is a task runner built on Node.js and npm, used for automation of time-consuming and repetitive tasks involved in web development like minification, concatenation, cache bustin... |
One of our sites has a bunch of separate CSS files & JS files being called and I want to optimise it all into a single CSS & a single JS file.
Someone mentioned you can setup Github to do this by having your files separate in GitHub repositories and it will build a new single master file that has all the code compres... | Github merge multiple files into single compressed master file |
Basically you are looking for dynamic SQL: this means using SQL to generate and execute SQL.In MySQL, the standard approach requires creating a procedure that uses a cursor to loop through the table names and generate the queries, then useprepared statementsto execute them. This can be tricky.For a one-shot action, I w... | Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed4 years ago.Improve this questionI have to update several tables to clean stacked cron jobs on a wordpress multisite install.The network has 50... | Clean multiple numbered mysql tables [closed] |
The Git configuration of user.name and user.email has nothing to do with the permission error. You can specify any email and username. Those two values goes only into the commit author information.
The real issue that you are facing is that you need two different github accounts. Your machine caches the first github a... |
In my github I set up my github username as follows (name and email changed for privacy)
$ git config --global user.name "Work"
$ git config --global user.email [email protected]
Which has worked fine for me until now, where I want to make a project that is stored under a different github account since it is hobby re... | Configuring github to use local username and email for one project? |
Well, it's not possible. You have to schedule three separate jobs:10,30,50 8-20 * * mon-fri //At minute 10, 30, and 50 past every hour from 8 through 20 on every day-of-week from Monday through Friday.
30,50 7 * * mon-sat //At minute 30 and 50 past hour 7 on every day-of-week from Monday through Saturday.
10,30,50 16 *... | I want to setup a crontab expression that will start a job at every 20 mins and it will run following the time table7-30am to 8pm Monday-Friday and 7-30am to 4pm SaturdaySo far I have the following,0 30 7 ? * MON-FRI Fire at 7:30am every Monday, Tuesday, Wednesday, Thursday and FridaySo far I have the following,<schedu... | Crontab quartz schedule |
Look at my example, I have aprivatesshkey in the directory where Idockerizeapp(ssh_keys/id_rsa), andpublickey I have already upload to the private repo:FROM ubuntu:14.04
MAINTAINER Alok Agarwal "alok.alok.com"
RUN apt-get update
#Install git
RUN apt-get install -y git
RUN /bin/bash -l -c "mkdir /root/.ssh"
ADD ssh... | I am new to docker, so was trying all basic stuff.I have used following dockerfile to generate my working docker imagesFROM ubuntu:14.04
MAINTAINER Alok Agarwal "alok.alok.com"
RUN apt-get update
#Install git
RUN apt-get install -y git
RUN mkdir -p /root/.ssh/
ADD id_rsa /root/.ssh/id_rsa
RUN touch /root/.ssh/kno... | Not able to clone private repo using dockerfile |
All metrics havejoblabel associated with them, based on job that scraped this metric.To exclude metrics from a single job you can use!=selector:node_memory_MemAvailable_bytes{job!="VM1"}To exclude metrics from multiple jobs you can use!=selector multiple times, or use regex not matching selector!~:node_memory_MemAvaila... | I have a rule in Alertmanager:- alert: HostOutOfMemory
expr: (node_memory_MemAvailable_bytes / node_memory_MemTotal_bytes * 100 < 10) * on(instance) group_left (nodename) node_uname_info{nodename=~".+"}
for: 1m
labels:
severity: critical
annotations:
summary: Host out of memory (instance {{ ... | How to exclude job in Alertmanager? |
Yes, you can use it to do the same task mostly you are doing withkubectl.kubectlitself is one type of client that you are using.Example:from kubernetes import client, config
def main():
config.load_kube_config()
api_instance = client.CoreV1Api()
# Listing the cluster nodes
node_list = api_instance.l... | Is it possible to usekubernetes python clientlibrary in order to get output similar tokubectl describe nodes? | Describe nodes api call in Kubernetes |
Since this is not for production, you could stick with your original "if" solution. You only need to escape from the "if" block to be able to proxy_pass, which can be easily done with the traditional trick:
location /banana {
error_page 418 = @good_old_fallback;
if ($args) {
return 418;
}
}
locat... |
I have a url http://foo.com/banana and I have another url http://foo.com/banana?a=1&b=2
I like that all /banana routes are handled by my local nginx, but I'd like any banana routes with GET params to be proxied to http://bar.com
so:
http://foo.com/banana -> http://foo.com/banana
http://foo.com/banana?a=1 -> (proxy) ->... | nginx proxy_pass url with GET params conditionally |
Same here:SonarQube - No translations: NS_ERROR_DOM_QUOTA_REACHEDThe cause of the problem is the localstorage.Open JavaScript console (F12 -> Console)TypelocalStorage.clear();-> EnterReload (F5)In the console you can seeNS_ERROR_DOM_QUOTA_REACHED: Persistent storage maximum size reachedThe localstorage max quota in fir... | I am having a localization problem when loading SonarQube 5.1.1 on Firefox.The same problem does not happen on Google Chrome.It does not happen only on my machine.Even when I try to load the Sonar online demo, the same problem happen:http://nemo.sonarqube.org/Wrong on FirefoxRight on Google ChromeHow can I fix that?Tha... | SonarQube + Firefox localization |
Yes, you can call the API server to retrieve all ingress rules:
https://kubernetes/apis/extensions/v1beta1/ingressesThis url would work within your cluster environment. Replace it with some public IP/Domain when calling it from the outside.You will need to authenticate using Bearer Token. That token is usually mounted ... | I want to list all ingress-urls on a kubernets cluster for every namespace.I know it´s possible with:kubectl -> kubectl get ingressnumerous clients, e.g. for python:https://github.com/kubernetes-client/python/blob/master/kubernetes/docs/ExtensionsV1beta1Api.md#list_ingress_for_all_namespacesFor my current situation, a ... | kubernetes -list ingress for all namespaces by REST-Call |
If you are using the concurrent mark sweep collector you can get fragmentation. however for new objects, provided there is a enough young generation space you don't need to worry about fragmentation as the free Eden space is always continuous.
In many applications, only a small portion of the heap is given to the youn... |
I start some java code with -Xmx1024m, and at some point I get an hprof due to OOM. The hprof shows just 320mb, and give me a stack trace:
at java.util.Arrays.copyOfRange([CII)[C (Arrays.java:3209)
at java.lang.String.<init>([CII)V (String.java:215)
at java.lang.StringBuilder.toString()Ljava/lang/String; (StringB... | can a OOM be caused by not finding enough contiguous memory? |
add this between your HEAD tags
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="-1">
|
How do you make Firefox rerun javascript and reload the entire page when the user presses the back button? I was able to do this in all browsers except Firefox from the help of another SO question by adding this code:
history.navigationMode = 'compatible';
$("body").unload(function(){})
And also adding an iFrame... ... | Force Firefox to Reload Page on Back Button |
What you want is to mergefeatureindevelopbut excluding changes that are not meant to be indevelop. I think the best solution is tocherry-pickyour commit with the changes that you want to merge intodevelop, this way you avoid merging something else into it:git cherry-pick commitShaHope this help.P.S.: One way to avoid t... | I acidentally branched off my organisations 'staging' branch. I've merged my changes into staging from the feature branched I previously branched off staging with so its now in staging.They now want it in develop, I can't merge the feature branch into develop as staging and develop are way different. What's the easiest... | Move differences of two branches into a third branch |
would like to share my candid response in a manner that I deem fit. These are just my personal views.A DevOps engineer is an integral part of any technology company, which is nurtured with trust and longevity. In terms of safety & security, they know all the weaknesses of the Development team (code) - and possible ways... | A devops person setups a server, installs SSL cert and apps.
He/she would therefore have access to SSL cert and its private key.
How should he/she be off-boarded in a way so that SSL cert is not misused by him/her afterwards?
Should this be part of some contract or should the cert be renewed?
What is the best way such ... | DevOps OffBoarding - SSL Certificate Issue |
It depends what you're using to display the data, for example a single stat or gauge you'll find the 'Decimals' option in Grafana, for graphs it's in the 'Axes' options. You don't need to do this in the query for the metric. | Is there a way to round a decimal value in grafana?round()andceil()functions gets an "instant-vector", not a numeric value, and for example, adding a query likeceil(1/15)will return0. | How to round an decimal value Grafana |
1
Your remote origin/master branch didn't get updated and fell behind the local master branch. They haven't diverged but the remote branch is 74 commits behind the local one. You have two options:
If the new changes in the local branch are made on purpose, just push them to... |
I have recently changed my code to be hosted on Github, and have been deploying it onto my live site using:
git pull origin master
Where origin is set to https://github.com/myname/myproject.
Everything works OK, except for git status, which shows:
# On branch master
# Your branch is ahead of 'origin/master' by 74 com... | Git: unable to resolve differences between master and origin/master |
A histogram is represented as a set of counters where each counter represents a bucket. It is typically used to track latency.Each bucket stores a number representing eventslessthan the bucket value.hello_world_latency_seconds_bucket{le="1.0",} 16.0
hello_world_latency_seconds_bucket{le="2.0",} 16.0
hello_world_latency... | to have a working prometheus histogram i need a bucket which is a set of values that when passed toobservemethod(i usehttps://github.com/prometheus/client_ruby) will be recorded. so when my bucket is :[1,2,3, 100]its going to record1as1,2.1as2etc.how can i make it record everything between 3 and 100 without explicitly ... | borderless prometheus buckets |
You can download following softwares to download projects like this1 . TheSVN2. TheGit | This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable,visit the help center... | how can i download code from git hub using command line [closed] |
14
You basically have a duplicate of Splitting a Branch in 2 The graphs there are good so not bothering to duplicate them.
First create a second branch pointing at your sixth commit
git branch branch2 HEAD~4
or
git branch branch2 COMMIT_6_SHA
branch2 is now done and re... |
How can I divide one pull request into two pull requests?
I committed ten times in one pull request, and I want to divide them into two different pull requests because the first six commits are unrelated to the last four commits.
I use Ubuntu os with git.
As I am new to git, I am wondering how to input git commands st... | how to divide one pull request into two different pull request on github |
The documentation says:Theserviceskeyword defines just another Docker image that is run during your job and is linked to the Docker image that theimagekeyword defines. This allows you to access the service image during build time. | I am using gitlab's pipeline for CI and CD to build images for my projects.In every job there are configurations to be set likeimageandstagebut I can't wrap my head around whatservicesare. Can someone explain its functionality? ThanksHere's a code snippet I use that I foundbuild-run:
image: docker:latest
stage: bui... | What are services in gitlab pipeline job? |
"red color" means "modified, not yet added to the index" (or they would be green).To get back their original content since last commit, simply do agit checkout -- afile:git checkout -- A.txt
git checkout -- B.txtThat will take care of step 6. No add, commit or push involved, just the removal of pending local modificati... | I am new to Git. My question is simple but I looked intothis SO LINKI could find the right answer.Step 1. Suppose I have a project with two files in it. A.txt and B.txt. I made some changes to file and eventually I pushed it to the repo.(all good till now)Step 2. Now I made some more changes in it. Suppose I added one ... | How to revert the changes made in file which has not been put in staging area using GIT |
1
You can use AWS SSO APIs to get this information. I haven't found documentation for them, but the SSO user portal uses them.
The first one (the organization id) can be retrieved using GET https://portal.sso.<SSO_REGION>.amazonaws.com/token/whoAmI. Search for the 'accoun... |
When you login via SSO in the browser, if you open one of your accounts and then assume a role, a new tab is opened after you click on "Management console". The syntax of the url of that link is something like https:/ /my-sso-portal.awsapps.com/start/#/saml/custom/my-account-name/base-64-string
If you decode that base... | How is the AWS SSO url generated when you access the management console? |
Afterwards there should be a cookie set with the Public key ID (not
the public key) and name and password, so that in the future you no
longer need to upload a certificate.Essentially, you're implementing an authentication system that offers no security at all.Whatever you call a "public key ID", is going to bepubl... | I am building a site where I will need a user to login with a name, password and a certificate. The way it should work is to upload the certificate the first time you login. Afterwards there should be a cookie set with the Public key ID (not the public key) and name and password, so that in the future you no longer nee... | PHP: Get public key ID from certificate. |
As of Git 2.19, this is finally possible, as can be seen inthis answer.Consider upvoting that answer.Note: in Git 2.19, only client-side support is implemented, server-side support is still missing, so it only works when cloning local repositories. Also note that large Git hosters, e.g. GitHub, don't actually use the G... | I have my Git repository which, at the root, has two subdirectories:/finisht
/staticWhen this was inSVN,/finishtwas checked out in one place, while/staticwas checked out elsewhere, like so:svn co svn+ssh://[email protected]/home/admin/repos/finisht/static staticIs there a way to do this with Git? | How to clone from a specific folder in GitHub? [duplicate] |
Try at least using https instead of git protocol (as inbower issue 102):git config --global url."https://".insteadOf git://Iftelnet github.com 9418does not work, it would mean the git protocol (which uses port 9418) would not be able to access GitHub.Clearing the cache (issue 50) can help too (on Windows:C:\user<user>\... | When I hit the command in my terminal:bower install angular-gridsterI receive the following error:bower ECMDERR
Failed to execute "git ls-remote --tags --heads git://github.com/sdecima/javascript-detect-element-resize.git",
exit code of #128 fatal: Could not read from remote repository.
Please make sure you have the... | Error when entering bower install angular-gridster |
You're not doing anything wrong, I have just encountered the same issue.
There seems to be a bug in the way the service interprets the service.beta.kubernetes.io/aws-load-balancer-eip-allocations annotation. If you remove the space after the comma it should work.
Try this:
annotations:
service.beta.kubernetes.io... |
I am creating nginx ingress controller of type nlb with static ips, but for static ips I am getting this error AllocationIdNotFound. Although this allocation id is valid and eip with this id is present in the same region.
Here are the annotations that I am using with nginx ingress controller service
annotations:
... | nginx ingress controller type nlb with static ip giving error "AllocationIdNotFound" |
You can downcast the numeric types in your data using the.astype(t)method to save memory to an extent. For example:rr.shape
Out[69]: (15000, 35)
rr.nbytes
Out[70]: 4200000
zz = rr.astype('float16')
zz.nbytes
Out[72]: 1050000 | I gotMemoryErrorfrom creating 4 matrices size:(115005L, 6005L) (9738L, 6005L) (115005L, 9738L) and (115005L, 6005L)in the same function. Now I am onPython 2.7.13 (Anaconda 64-bit)in Windows. Is updating python to 3.x the best way to solve the problem? Or how to solve MemoryError without modifying hardware? I have to us... | What are the programming ways to solve MemoryError (raising from creating large matrices)? |
Make another .htaccess fora-z0-9.example.comwith the code bellow:RewriteEngine on
RewriteCond %{HTTP_HOST} a-z0-9.example.com [NC]
RewriteRule ^(.*)$ http://www.a-z0-9.example.com/$1 [L,R=301,NC]I think this will work.Good Luck!ShareFollowansweredNov 30, 2015 at 16:28arodebaugharodebaugh53811 gold badge99 silver badges... | I want to make a URL change whenever clients access my website withexample.comtowwww.example.comI have used .htaccess for this but it works not correct.Because nowa-z0-9.example.comwil also redirect towww.example.com, I want this only works forexample.comthan redirect towww.example.com.HTACCESSRewriteEngine on
RewriteC... | Redirect domain to WWW |
Yes load balancing will be provided by kube-proxy. If you look at the endpoints by describing a service you will find that IPs of pods backed by the service are listed there. So when request comes to the any nodes IP and NodePort it will be load balanced by kube-proxy between those pods. The way it works is request com... | I am running 3 nodes in Kubernetes cluster. Each node has the same Pod myApp.
I create a service using type NodePort so that all 3 Node is accessible from external.
The service yaml looks like belowapiVersion: v1
kind: Service
metadata:
name: myService
labels:
app: myApp
spec:
selector:
app: myApp
type:... | Service Node Port across multiple nodes |
After a few hours searching I found the solution: (credit)
My setup is ubuntu 18.04, lxde, thisdocker buildI modified the run script like this:#!/bin/bash
#
# Run JMeter Docker image with options
NAME="jmeter"
JMETER_VERSION=${JMETER_VERSION:-"5.4"}
IMAGE="justb4/jmeter:${JMETER_VERSION}"
# Finally run
xhost +
docker... | i made a Docker-Image of JMeter because I want to run it remote (and from a cloud). If I run the Image I am getting the error: 'No X11 DISPLAY variable was set, but this program performed an operation which requires it.'I've updated the ssh_config file and the sshd_config file (as mentioned in similiar questions) but i... | X11 Display variable is not set - can't run Docker Image |
You'll want to dispose of the IDisposable classes Stream and StreamReader:
using (Stream stream = response.GetResponseStream())
{
using (StreamReader reader = new StreamReader(stream))
{
responseFromServer = reader.ReadToEnd(); //IT THROWS OUT OF MEMORY HERE
}
}
Classes that implement IDisposabl... |
What could be causing an out of memory exception in the code below? My program was running for a few hours and then died. The code only sends/receives a very small amount of data each time, so there are no huge files or strings going over the wire or coming back. The code sends and receives from the server every 3 ... | OutOfMemoryException reading response stream |
You can use redshift COPY command with parameterTIMEFORMAT 'epochsecs'orTIMEFORMAT 'epochmillisecs'Checkredshiftdocumentation for more details | Is there any way to format the epoch to timeformat 'YYYY-MM-DD HH:MI:SS' while
doing redshift copy from s3 to redshift using COPY command | Epoch to timeformat 'YYYY-MM-DD HH:MI:SS' while redshift copy |
It sounds like you installed the SSL certificate on your Elastic Load Balancer, so that's where SSL Termination is happening. So your load balancer is doing the SSL termination and always communicating with your server via HTTP. This means you have to check the 'x-forwarded-proto' header to determine if the original re... | Im trying to redirect HTTP requests to my site to HTTPS. Its been extraordinarily hard. My code is:var express = require('express');
var app = express();
app.use(function(req, res, next) {
console.log('req.protocol is ', req.protocol);
console.log('req.secure is ', req.secure);
if (req.url !== '/health' && !... | Req.secure in Node alwys false |
Database triggers are the preferred way to go here, if you can.However, recently I had to do this in client-side code and I ended up writing a class that created a deep (value) copy of the object when it was opened for editing, compared the two objects at save time (using ToString() only) and wrote any changes to an au... | I need to implement an audit trail for Add/Edit/Delete on my objects,I'm using an ORM (XPO) for defining my objects etc. I implemented an audit trail object that is triggered onOnSavingOnDeletingOf the base object, and I store the changes in Audit-AuditTrail (Mast-Det) table, for field changes. etc. using some method s... | How do you implement audit trail for your objects (Programming)? |
If forking allows you to list that repository in your GitHub repository pages, then all you need to do is:make any change in the original repository (since your have collaborator rights)do not commit directly in your forkfetch from the original repo URL (named "upstream"), mergeupstream/mainand push from a local clone ... | I want to share on my personal GitHub repositories page a repository uploaded by my collaborator on his personal GitHub page. I have collaborator permission in the repo's admin settings and I can see the repository in my GitHub after clicking on my image and clicking on repositories. Moreover, the repository is public.... | GitHub shared repository |
You could replace your template with something like this:{{ define "__subject" }}[{{ .Status | toUpper }} {{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .GroupLabels.alertname }} ({{ .GroupLabels.group }} {{ .GroupLabels.instance }})Not sure what will happen if thegrouporinstancelabels are not com... | I have prometheus alert manager running with a template, and im getting email subject as following[FIRING:6] Unusual network throughput out (thanos group_b aws_us_b
instance_191 infrastructure monitoring-prometheus-node warning)all the values after the alert name are labels.
here is the template subject code{{ define... | Prometheus alert manager template changes |
5
+50
I'd check and see that:
MIME type really is text/cache-manifest.
Your cache-manifest starts with CACHE MANIFEST, your urls thereafter are either relative to the manifest or absolute URLs.
You don't have any broken links in your man... |
This is regarding HTML5 offline apps on Android devices.
We are running into an issue where bookmarking an offline capable HTML5 app (with a complete cache manifest file) fails to load on the Android browser under the following conditions:
Bookmark the app on the browser
Switch off all wireless connectivity
Close th... | HTML5 Offline app on Android devices |
See this warning in the SSL log:no suitable certificate found - continuing without client authenticationYour server is sending a list of accepted CAs to request a client certificate, but your client does not find a suitable one. It seems your keystore has the correct certificate. Ensure that your certificate is correct... | We are trying to access a restful web service resource hosted onIIS serverwith https protocol.When we disableTWO WAY SSL Auth(server side validation of client certificate disabled) everything works fine.When the IIS imposesTWO WAY SSL(server side validation of client certificate enabled) we are getting the below except... | SSL client (Java) is not sending a certificate back to the server in two-way SSL handshake |
It was DNS related found my solution here:Docker - Network calls fail during image build on corporate networkTLDR; gotta config the DOCKER_OPTS with my DNS IP. | I am deploying some node.js services to a corporate system within docker containers. My Dockerfiles for these services are very basic, with the exception that I am setting the proxy environment variables:FROM node:4.2.3
ADD . /src
WORKDIR /src
ENV http_proxy http://proxy.gc.corp.com:8888/
ENV https_proxy http://p... | NPM install fails inside Docker container but runs on host w/ corporate proxy |
instead of having a cron job for each reminder (or notification, whatever), you might write everything in a file and periodically (for example every 5 minutes) call a script (e.g. php-script) that reads the file and checks whether to send a notification or not...you would have the functionality without needing to creat... | I want to send emails through a web app, for example, reminders of a tasks manager, reminders of birthdays... I want to program a date and an hour, and get the email sent at that moment.I think I have two options to do this: using cron or sending email with a future timestamp.Using cron involve to run a command (which ... | Best method to send programmed emails from web application |
To solve your problem to find the tag hash, you can use the following command:git rev-parse TAGThis will show you the commit hash. | This is my forked repoIt is a VERY large repo with a few hundred thousand commits and branched 20+ deep. Only the commits with tags that have (-r#) are ones for my hardware. I have a patch that I have applied to the sunxi-v3.4.24-r1 tag.git clone https://github.com/iceblu3710/linux-sunxi-xenomai
git checkout sunxi-... | Git Branch, Rebase, Merge & Tags |
Images in Docker don't have a name, they have tags.A tag is a reference to an image. Multiple tags may refer to the same image.If you reassign a tag that is already used, then the original image will lose the tag, but will continue to exist (it will still be accessible by its image ID, and other tags might refer to it)... | If I build a new docker image with the same name as existing ones, will the old ones be overwritten? | If I build a new docker image with the same name as existing ones, will the old ones be overwritten? |
I hope this link can help on a corporate proxy issueConnect to MongoDB database using mongoose behind a proxyAlso, you can look into Nginx as a proxy, depending on your company configuration, though I see you're working wit Nextjs, most of it will depend on the configuration used at your company | Goal: Connect to a public facing mongodb instance in my local development environment, which is connected to my corporate network.Background: There is a proxy available for bypassing this corporate firewall. I am developing a Next JS application with mongo as the backend.Ask: How do I use this proxy to connect to the m... | Connect to MongoDB using mongoose with proxy |
You shouldn't recreate the bitmap on every step of the rotation, instead you should just try to draw it rotated. That's also possible with a Matrix (what you already use) and will avoid the excessive memory usage.Android: How to rotate a bitmap on a center point | i try to rotate 3 imageViews (or better the Bitmaps behind them) every 10-100ms.
i do the rotation like this:ImageView ivLoad;
Bitmap bMapLoad;
....
Matrix mat=new Matrix();
mat.reset();
mat.postScale(1.55f, 1.55f);
mat.postRotate((float)currentLoadDegree+(float)LoadDegree);
bMapLoad = Bitmap.createBitmap(bMapLoadgr... | createBitmap() leads me into a java.lang.OutOfMemoryError |
To grab a full copy of another user’s repo when you do not have a local repo already, you >will use git clone URL.For public repos, the URL can be a read-only URL like git://github.com/user/repo.git or an >HTTP read-only URL likehttp://github.com/user/repo.git.
For public repos you own or are a collaborator on, and a... | I have created a github account where I have created a repository with a sample project. I have checked out (cloned) this project on a machine A where I have also generated public/private keys using eclipse (Key Management) and uploaded the public key to my github account. I can push my changes on machine A to the gith... | Push to github from another machine? |
The problem is this line:
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ in store.jsx
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ is only available if you have Redux Web Tools installed on your browser. Your app didn't run for me locally either. However, once I installed the extension, it ran co... |
I have such problem, after deploying my React app on GitHub it works only in my PC. When I open link where is my App have to be deployed using my PC or LapTop link - it works, but when I tried to open it with phone or send this link to my friend - there is empty page (with my background). So how to solve this problem?... | After deploying on GH pages the app doesn't work |
Both are valid ways of doing things. If you use kubernetes, Amazon Container service etc you probably have to use option 2 as they do not support host mounted volumes. Option 2 is also more portable as you can move containers around on a multi-node docker swarm easily. However, if you already have a deployment system ... |
I am using docker and I mount my code in /var/www/code in host in my development.
Now when I want to release my stuff in production I have two doubts
Do I follow the same process and update the code in production host with deployment script
Or my production image does not have any host mounted volumes and even I put ... | Should the docker production image needs code as volume or not |
cron is permanent. So the accepted answer given in the linked question would run the script at 7 AM everyday. It has nothing to do with if you are logged in or not.ShareFollowansweredJun 15, 2011 at 18:42amit_gamit_g31.1k88 gold badges6464 silver badges121121 bronze badges3Agree, cron shouldn't go away when you log out... | I just recently asked this question:https://stackoverflow.com/questions/6359367/running-a-bash-program-every-day-at-the-same-timeThe solution of using crontab -e to create a job worked very well and my script worked fine.
However, I found that once I exited the terminal, that job was deleted. How can I create a job med... | Creating more permanent crontab files |
You needgit filter-branchfirst, then ask everybody to rebase branches created off of your old history.Refer to:https://help.github.com/articles/remove-sensitive-data/This is complex, and might cause issue, so next time be careful so not to get there.If you can't do that due to some reason, then need to wait until time ... | I have a couple of files that are in the repo and also in .gitignore.I would like these files to be removed from the repo but not be deleted from my production server when I dogit pull origin masterI have tried multiple solutions but none seam to work, in each one I end up deleting the files from the server when I do a... | Git: How to remove files that are now in gitignore but were added to repo before |
Actually tar does not erase data as a default. But any files that are contained within the tar archive will overwrite files of the same name if they are already present. Likewise a sub-directory's contents will not be overwritten if the tar archive does not contain files matching them.
mkdir -p foo/bar/
touch foo/fil... |
I made several backups on different directories with Backup Manager. Eg: /home/user1 /home/user2...
It gives me some tar files. The content of a tar file looks like :
home/user1/
home/user1/.profile
home/user1/.bash_history
home/user1/.bash_logout
...
I tried to test the restoration with something like :
tar -xvzf h... | Can tar extraction erase brother directory ? |
3
Three ideas:
Ensure "bind_ip" is set to "0.0.0.0" in your mongod.conf and restart mongod, as @ajduke suggests.
Make sure mongod is running.
Try to connect to the mongod from your client machine using the "mongo" shell to see if it gives you a more informative error.
... |
An error is repeatedly being thrown at this line:
client = MongoClient('ec2-12-345-67-89.us-east-2.compute.amazonaws.com', 27017,
ssl=True, ssl_keyfile='C:\\mongo.pem')
(Paths and instance name changed for obvious reasons)
The port (27017) for mongo is allowed inbound connections from my AWS security gro... | Using Pymongo to connect to MongoDB on AWS instance from Windows |
Something is very odd here. Why do you have the virtualenv content next to your Dockerfile?
The image you are building from creates the virtualenv on /var/app (within the container, yes?) for you.
I believe that the ONBUILD command copies it (or parts of it) over and corrupt the rest of the process, making the /var/ap... |
Trying to follow a few[1][2] simple Docker tutorials via AWS am and getting the following error:
> docker build -t my-app-image .
Sending build context to Docker daemon 94.49 MB
Step 1 : FROM amazon/aws-eb-python:3.4.2-onbuild-3.5.1
# Executing 2 build triggers...
Step 1 : ADD ... | Docker Build can't find pip |
Yes, you can use multiple source and sinks in a single data flow and reference same source over join activity. And order sink write using Custom sink ordering propertyI am using Inline dataset but you can use any typeUsinginline datasetto store the result insink1. Insource3, use the sameinline datasetto join withSource... | I am trying to load the sales data to the database using Azure Synapse Analytics pipelines, and the strategy is as follows (scenario is made up):Load the students` data to the table StudentsLoad the students` classes information to the table StudentsClasses. In this data flow I need to join the data with the Students t... | Can you use a data flow sink as a source in the same data flow? |
Your certificate is outdated, that's why.The easiest solution is to switch to ssh protocol (git://) after setting up the ssh keys.Once you setup the keys and after adding them to the github account change the clone protocol and you will be able to clone and work. | I can't seem to import a project from gitHub. I get an error message saying:"Clone failed: unable to access 'https://github.com/myGitHubUsername/projectName.git/': error setting certificate verify locations:"I've heard people have this error before, but the key difference is that my intellij doesn't specify what locati... | Intellij IDE can't import project from gitHub |
It looks like you have two active network interfaces, one onenp1s0and another onwlp2s0. I'd guessenp1s0is an Ethernet connection andwlp2s0is a WiFi connection.As mentioned in the question you linked to, if you have multiple addresses on different interfaces, you have to specify one with--advertise-addr. In your case, y... | My question is similar todocker swarm init could not choose an IP address error, but I found the accepted answer somewhat vague so I'll ask again. Upon tryingdocker swarm initI'm geting an error messageError response from daemon: could not choose an IP address to advertise since this system has multiple addresses on di... | In Docker, "Error response from daemon: could not choose an IP address to advertise since this system has multiple addresses on different interfaces" |
In this case, a static resource refers to one that is not generated with code on the fly, meaning that its contents won't change from request to request.Images, JavaScript, CSS, etc., are all candidates for this. Basically, you set a large cache time for these resources, and your Nginx servers can keep a copy on disk ... | I am primarily a front-end developer/designer, however recently, I've been exploring end to end solutions. Yesterday I finished a TODO application using the mean stack and would like to start exploring deployment options to my VPS.That being said, I've been advised to use nginx as a reverse proxy is for serving up sta... | What's difference between static and non-static resources? |
One of the reasons I encounter is that I list the bucket resource as:
arn:aws:s3:::my-datasets
arn:aws:s3:::my-datasets/*
But under my "my-datasets" bucket there is no child folder. Thus the "/*" confuses AWS because when it evaluates this policy it can't find anything under "my-datasets". After I created a new folde... |
Policy json
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "...",
"Effect": "Allow",
"Action": [
"s3:*"
],
"Resource": [
"arn:aws:s3:::bucket-name"
]
}
]
}
This is whats shown as a warning in the AWS console:
This policy defines some actions, reso... | To grant access, policies must have an action that has an applicable resource or condition |
1
You need to define 'backend' somewhere. Try something like this:
upstream backend {
least_conn; # this is your load balancing strategy, see http://nginx.org/en/docs/http/load_balancing.html#nginx_load_balancing_methods
server 172.16.10.10;
server 172.16.10.1... |
I've read a tutorial on configuring nginx to reverse proxy
https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-14-04
In the configuration file, we use a sock
server {
listen 80;
server_name server_domain_or_IP;
location / {
include uwsgi_... | Nginx reverse proxy + load balancing for uwsgi and flask application |
Chrome should certainly treat requests with varying query strings as different requests; a cached result for style.css?v=123 should never be used for style.css?v=124. If you're seeing different behavior, please file a bug at http://new.crbug.com/ and post the bug ID here.
That said, I'd first check to see whether the ... |
I've got a web service that, like most others, uses js and css files. I use the old trick of appending a version number to the js and css file like; ?v=123 and that gets changed every time we update the service on production.
Now, this works fine on all browsers, except for Chrome. Chrome seems to prefer it's cached... | Chrome caching like a mad browser |
For those who are interested, i found a solution to my problem with vbscript :option explicit
Const NET_FW_PROFILE2_DOMAIN = 1
Const NET_FW_PROFILE2_PRIVATE = 2
Const NET_FW_PROFILE2_PUBLIC = 4
Dim fwPolicy2
Dim InterfaceArray
Set fwPolicy2 = CreateObject("HNetCfg.FwPolicy2")
InterfaceArray = Array("LAN")
fwPolicy... | Im looking forward to configure my firewall under windows 7 for different interfaces throught a .bat file using netsh
In Win XP netsh has the parameter "interface" which allow me to specify the interface that I intend to enable the firewall for it, the opening ports for it...
In windows 7 the parameter interface is not... | Configure firewall under Win7 for different interfaces command line |
-a is short form for the --all. option This option will show all the containers both stopped and running.
ps is an abbreviation for "process status". Normally, docker ps only shows the running containers, but adding the -a option causes it to show all containers.
You can find more details in the Docker "ps" options do... |
Anyone who works with Docker regularly is familiar with the common commands docker ps and docker ps -a.
I know that docker ps lists all running containers in the Docker engine, but what does the "ps" actually mean?
I also know that docker ps -a has the effect of also listing containers that have stopped, but what does... | What is the meaning of "docker ps -a"? |
As a solution i added command arguments using inline if statement conditional and immediately concat it ,inside sonarqube.yml using bash script when github.event.number and pullrequest.base is null- name: Run sonarqube
run:
sonar-scanner
-Dsonar.dependencyCheck.htmlReportPath=dependency-chec... | I want to create conditional pr_number variable and after assign it to the Dsonar.pullrequest.key. This is how I am trying to do it, but it's not working: pr_number remaining undefinedname: SonarQube
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
sonarqube:
runs-on: ... | SonarQube: how to use bash script variable inside yaml file |
You can use Git GUI for windows and use it easily. I created the repository in the GitHub and then use windows UI to clone and work on it.
You can download git UI from below location.However as I have read UI is not supporting all kind of master level git functionality which you can use from git bash/command line.Git f... | I am facing the issue to create the git repository using tortisegit and git gui tool. Can any one help me to provide the steps to create the git repository using GUI tools.I have checked in stackoverflow for same and found enough. | Create git repository using tortisegit |
if(gid%2==0)is the opposite ofif(gid), the former is true for even numbers, the latter for odd ones.Well, as it is written currently, half of the threads will do nothing.Instead, you should use__kernel void oddcopy(const __global const int *a, __global int*b) {
int gid = get_global_id(0);
b[2*gid+1] = a[2*gid+1... | I'm studying OpenCL and I'm trying to do this exercise but I don't know how to write the corresponding kernel code in order to avoid the branch-divergence problem.I write something like that but I don't know if I'll problem or branch divergence__kernel void oddcopy(const __global const int *a, __global int*b) {
int... | OpenCL kernel and odd copy |
If you're using Python 3.2, there's already a good caching decorator in the standard library:import functools
@functools.lru_cache(maxsize=1000)
def fun(...):Otherwise, I'd just have a look at the implementation oflru_cache. It's a good pure-Python general-purpose memoizer with LRU semantics (like the FIFO semantics y... | I'm using this memoize decorator on a class and it is very effective. Now I'm ready to trade some of that speed for control over memory consumption. Ideally I'd be able to set a maximum; (eg: 2GB) but I guess I can trial and error a lot and settle for a maximum number of objects in the cache.Anyone know of some ready-... | How to apply a maximum cache size to memoize? |
tryif ($host ~* \.ru$) {
set $language 'ru-RU';
}
add_header Accept-Language $language;setting the variable with $http_.... is probably not the best idea as variables starting with $http_ are interpreted and set with by nginx itself (specifically the name you used would mean 'content of the http header 'accept_langua... | I would like nginx set an appropriate accept-language header depending on requested domain:www.domain.ru setru-RUwww.domain.com seten-USwww.domain.de setde-DEwww.domain.eu do nothing let Django get the header from the browser.
For 3 specified above domains force changing of the accept-language header even
if english... | Mapping accept-language header to domain with nginx (and django) |
8
Then why does it have to be 6 times?
The explanation is given in the next sentence:
The extra time allows for Lambda to retry if your function execution is throttled while your function is processing a previous batch.
This is just a recommendation. You don't have to... |
From https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html#events-sqs-queueconfig
Set your queue visibility timeout to 6 times your function timeout, plus the value of MaximumBatchingWindowInSeconds
Why can't the queue visibility timeout be equal to the function timeout? Let's say the function has a timeout of ... | Why is queue visibility timeout is recommended to be six times function timeout plus batch window? |
1
You could use the dd command and stream the output to s3
From within the instance:
$ dd if=/dev/xvda bs=1M status=progress | aws s3 cp - s3://your-bucket-name/root_device.img
substitute the /dev/xvda with the file system you want to back up
Share
Improve this... |
I have a running instance in EC2. Its "Root Device Type" is Instance-store (not EBS).
And I'd like to back it up manually into S3.
Is it possible?
Thank you!
| Is it possible to backup an AWS EC2 "instance-store" type instance into S3? |
Currently it is not possible.I contacted github staff and here's their answer :This is not possible currently. Thanks for the suggestion though! I have added it to our list for our team to consider.I also opened an issue on this repo :https://github.com/isaacs/github/issues/542I'll edit the answer if it changes some da... | It's simple to display open/close issues on Github :When you make a commit to solve an issue, you can reference the issue in the commit name with for examplecloses #4,close #4,fixes #4,fix #4, etc.Once the commit is pushed, the issues is closed.
BUT, if you're working in adifferent branch than the default one(usually m... | How to display only issues that would not be closed by a "Fix #123" commit message once merged into the default branch? |
2
Did you measure it? Is there a user apparent performance issue on the least capable piece of hardware that you are supporting? Did you test it in both low-bandwidth/high-latency vs. high-bandwidth/low-latency situations?
If there is no apparent issue to the user acros... |
I'm using "Requests Buffer" class as a @property of my main Model class. There is a lazy instantiation for the buffer and when there are no items to process in the buffer model sets it to nil. I'm wondering if there is a reasonable frequency for allocation and deallocation of the complex buffer object? And when may be... | Frequent Allocation/Deallocation of an Object - Objective -C |
In your settings.py file, add the following line. When DEBUG = False, as it should be when you're online, the following will email you whenever an error comes up. That way the full error log is never shown to other people.
ADMINS = [('your_name', 'you@your_email.com')]
But you will need your email server set up for t... |
I have developed a Django app locally, and I am used to seeing the error messages on the webpage when things aren't correct with my programming.
I have now moved this app over to digital ocean servers, using Ubuntu, NGINX, and gunicorn.
Now when I have a problem in my Django code someplace, I get served very basic er... | How to see Django errors using NGINX and gunicorn |
The name of a Docker image identifies the repository that it comes from. For example:docker pull aws_account_id.dkr.ecr.us-west-2.amazonaws.com/amazonlinux:latestThe registry isaws_account_id.dkr.ecr.us-west-2.amazonaws.com, the image name isamazonlinux, and the version islatest. The punctuation characters/and:separate... | I'm trying to set up some infrastructure using AWS ECR to store docker images. I'm just wondering if I have access to the same base images that I do in the docker hub. E.G.FROM nodeworks in my Dockerfile after I log in to ECR. I'm just wondering where this image is getting pulled from. I can't find anything regarding a... | Where do docker images get pulled from when I log into a different image repository? |
Calling ~T() is exactly how std::vector handles the problem.
You do however have a couple of problems:
Firstly, push_back needs to use placement new to copy-construct the value into the vector. You can't just use assignment.
Secondly, you can't call realloc - if the object have internal pointers, they are going t... |
I'm trying to implement my own std::vector for sake of practice. Current source code:http://pastebin.com/bE4kjzcb
Here is an outline of my class:
Array() allocate some memory using malloc()
push_back(const T &t) add one element, call realloc() if necessary.
~Array() call free() to release memory.
The major issue wi... | How does std::vector destruct its objects? |
When you are inside a container, you cannot access the localhost directly. You will need to add docker.for.mac.localhost to your prometheus.yml file. See below:Your Job in prometheus.yml file.
- job_name: 'prometheus'# metrics_path defaults to '/metrics'
# scheme defaults to 'http'.
static_configs:
- targets: ['loca... | I am running a node applications locally. It runs onhttp://localhost:3002usingprom-clienti can see the metrics at the following endpointhttp://localhost:3002/metrics.I've setup prometheus in a docker container and ran it.DockerfileFROM prom/prometheus
ADD prometheus.yml /etc/prometheus/prometheus.ymlscrape_configs:
-... | Node.js + Prometheus - Target Down Connection Refused |
3
What you need is a "view" rather than a container. Containers own their elements and their main purpose is to encapsulate the raw memory they manage. If you need to manage the memory yourself then you dont need a container. Take a look at string_view that would be your so... |
Given a raw array of elements, how to create a std::vector that takes ownership of the raw array without reallocate & copy?
For example having the raw array:
int* elems = new int[33]
how to create a std::vector of size 33 pointing to elems?
I am sure that theoretically this is possible, as usually std::vector is imple... | Create std::vector in-place from raw data |
date_of_signup between $__timeFrom() AND $__timeTo() | I made a time-series graph screenshot attached and the generated query isSELECT
UNIX_TIMESTAMP(date_of_sign_up) DIV 600 * 600 AS "time",
status AS "borrower_status",
count(id) AS "Number Of Borrowers"
FROM borrowers
WHERE
date_of_sign_up BETWEEN FROM_UNIXTIME(1631158800) AND FROM_UNIXTIME(1643881661) AND
stat... | Write mysql custom query in query builder of grafana |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.