Response stringlengths 15 2k | Instruction stringlengths 37 2k | Prompt stringlengths 14 160 |
|---|---|---|
You can try to overwrite parent cache function. Just replace another htaccess file under desired folder and set to cache for 1 sec. Worked for me.ExpiresActive On
ExpiresDefault A1
Header append Cache-Control must-revalidate | I have a .htaccess file that handles the browser caching. I set the rules with file extensions. How can I modify the following snippet toexclude a specific directory from the browser caching?<FilesMatch "\.(gif|png|jpg|js|css|ico|woff|eot|svg|ttf)$">
Header set Cache-Control "max-age=2592000, public, must-revalidat... | Exclude directory from browser caching with .htaccess |
1
What worked for me instantly is to create a new .md file with the page content I want on a new page and in my main page link to this new .md file. For example, my main page uses README.md, I also have about.md within an /other-pages/ folder, thus, somewhere within README.... |
I am creating the Github page for showing my profile. My first page is the main one (https://<username>.github.io/) to show an overview of my bio. And, I would like to add another page that shares the same theme with the main page (https://<username>.github.io/<new_page>). I would like to use this page to showcase my ... | How can I create new page on the GitHub page with the same theme as the main page? |
2
It seems some caching in our company local network was the reason why some files seemed not to be gzipped. When I connect from home everything was ok.
Share
Improve this answer
Follow
answered ... |
I have problem with nginx + gzip + rails configuration. My nging.conf looks like this:
gzip on;
gzip_http_version 1.0;
gzip_comp_level 2;
gzip_proxied any;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_types text/plain text/html text/css application/x-javascript text/xml application/xml application/xml+rss text/java... | Nginx and Rails gzip configuration |
Aqueueis well-suited to finding and removing the oldest members.A queue implemented as a doubly linked list has O(1) insertion and deletion at both ends.Apriority queuelends itself to giving different weights to different items in the queue (e.g. some queue elements may be more expensive to re-create than others).You c... | I got an interview question saying I need to store few millions of cache and then I need to keep a track on 20 oldest cache and as soon as the threshold of cache collection increases, replace the 20 oldest with next set of oldest cache.I answered to keep a hashmap for it, again the question increases
what if we wanna... | How to store few millions of cache and then track down 20 oldest cache |
Yes, there is a race here. Different teams are reading and writing to the same element of the array 'y'. Perhaps you want something like this?for(i = 0; i < n; i++) {
#pragma omp target teams distribute parallel for
for (j = 0; j < n; j++){
y[j] = a*x[j] + y[j];
}
} | i'm trying to utilize my Nvidia Geforce GT 740M for parallel-programming using OpenMP and the clang-3.8 compiler.When processed in parallel on the CPU, I manage to get the desired result. However, when processed on the GPU, my results are some almost random numbers.Therefore, I figured that I'm not correctly distributi... | How to distribute teams on GPU using OpenMP? |
You can use includes and then just deal with creating and removing symlinks. Usually you see this done with server blocks (the base nginx.conf actually just includes conf.d/* which is how it loadsyourserver blocks), but it can be done with anything. Basically you'll have two folders, named something like locations-avai... | Say I have a config in/etc/nginx/conf.d/myscript.confserver {
listen 8080;
server_name _;
location = /a {...} # <-- needs to be disabled during maintainence
location = /b {...}
location = /c {...} # <-- needs to be enabled during maintainence
}For maintainence I need to disable/alocation, do some commands\de... | How to disable location in nginx from bash command line? |
That duplicate error is coming because of prometheus pod runs as an statefulset. Pod name isprometheus-k8s-1and it doesn't changes.You may need to use some other parameter inon(namespace, pod)like uid or something else which is unique at any instance. | Utilizing prometheus federation for kubernetes monitoring.Trying to change this promql query for multiple clusters:countby(node) (sum by(node, cpu) (node_cpu_seconds_total{job="node-exporter"}
* on(namespace, pod) group_left(node) node_namespace_pod:kube_pod_info:))
For multiple clusters, the query is giving:
Error e... | Promql queries for federated servers |
add environment variables for java and also ensure that you have added that Java to your IDE. Most probably its not selected that's why you are seeing this error.ShareFollowansweredApr 26, 2021 at 5:15krishna thotakrishna thota30711 gold badge44 silver badges88 bronze badgesAdd a comment| | I made 3 Java files and uploaded them to a git repository. I then cloned that repository onto VS Code and it linked up perfectly.After committing and pushing my first version, it came up with the error mentioned in the title on every Java file.(Let me know if you need any more information) | ".java is not on the classpath of project, it will not be compiled to a .class file" error |
Well, after more digging and investigation, my problem is finally RESOLVED!Turns out that after updating to 1.4.2, I still had some modified 1.4.1 catalog price rule files in my local mage folder that were preventing the rules from running properly. I deleted those.After that, I also had to set my Cron schedules in Con... | My catalog price rules consistently fail..They've failed ever since 1.4.1. I've upgraded to 1.4.2 because some people said that it was fixed, unfortunately for me it wasn't.Cron runs. Cron job monitor reports various tasks being scheduled and successfully running. Everything except catalog price rules. What is the matt... | Magento Catalog Price Rules |
Notice the backslashes your command prompt:C:\Users\Anon\Documents\GitHub [master +1 ~0 -0 !]>This indicates that you are usingcmd.exeor PowerShell, not Git Bash (which uses forward slashes). TheSet-Locationpart suggests PowerShell. As a result, you should use Windows-style paths in yourcdcommand:cd C:\Users\Anon\Deskt... | GitHub change directory not working.I put in: "cd /C/Users/Anon/Desktop/Git_Ballsy", and GitHub (terminal) keeps throwing this...C:\Users\Anon\Documents\GitHub [master +1 ~0 -0 !]> cd /C/Users/Anon/Desktop/Git_Ballsy
Set-Location : A positional parameter cannot be found that accepts argument 'Anon/Desktop/Git_Ballsy'.
... | [Git]Hub change directory not working. What is the issue? |
I found the answer after some research. Problem was CDK not deploying the node_modules folder and other folders which are outside the folder which contains the lambda source file.
When creating the lambda file root path has to be added to the 'code' attribute so that it will take all the folders/files inside it and de... |
I am deploying some apis to API Gateway using cdk. My problem is the file that contains the lambda(index.ts) can't import any files or npm modules outside that folder(folder named get-users).
I tried copying node_modules folder and other files (which were outside the folder get-users) to the folder get-users and it wo... | Lambda can't find modules from outer folders when deployed with CDK |
CallingClient()without any arguments starts aLocalCluster()by default, soclient = Client()Is really the same ascluster = LocalCluster()
client = Client(cluster)So, to start, you might take a look at the LocalCluster documentation.what are the default values for the parameters:Theidealvalues depend both on your hardware... | I am trying to understand Dask-ML'sClient()function parameters. Say I have the following code using Dask-ML'sClient()function:from dask.distributed import Client
import joblib
client = Client()If I don't specify any values for the parameters in theClient()function, what are the default values for the parameters:(i)n_w... | What are the default values for the parameters in Dask-ML's Client() function |
Both account will work without any problem but you should configure the remote link for Github and Bitbucket for example for github account:git remote add github https://github.com/username/repositoryName.gitAnd push to githubgit push github masterFor bitbucket account:git remote add bitbucket https://bitbucket.org/wor... | Hi I share the same username and email for my github and bitbucket account . Now I have configured git on my linux pc with the below commands$ git config --global user.name "user name"
$ git config --global user.email "email"As I have same username and email for github and bitbucket which account will work in this ... | Same username and email for both github and bitbucket account |
Create a file system on the EBS and then mount it. Seehttp://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.htmlSet ownership of your filesystem to postgres.Use the initdb command to initialize your new space.Tell postgres to use your new file system, by using the -D option to
the postgres binary, sett... | 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, ... | Storing Postgres data on a separate AWS EBS volume. [closed] |
If you want to redirect from like:site.com/index.php?blabla=1&id=32tosite.com/contact.htmlthen use:<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{QUERY_STRING} blabla=1&id=32
RewriteRule ^(.*)$ http://www.site.com/contact.html? [R=301,L]
</IfModule> | I have read about htaccess redirect and rewrite on stackoverflow and on other sites and learned how to redirect simple pages and directories, but there are about 30 links remaining that I haven't been able to redirect. The reason appears to be because they contain "?" in the link's URL. I've tried the solutions posted ... | How can I redirect old pages with question marks in the URL? |
Use the following query:kube_node_status_condition==1 | I have a metrics called - kube_node_status_condition in which I have elements that have value 0 or 1.I need to write the query in such a way that it will only list the elements which has value 1. How to do so? Thanks in advance. | How to write query on the elements value in prometheus |
1
The single biggest thing causing you immediate trouble is this Compose override:
# delete this line
entrypoint: /bin/bash
This tries to run an interactive shell instead of your dev server; but since Compose runs background services, this shell exits immediately and you c... |
I want to run vue on node image in docker container. But when i do "docker-compose up --build -d", i can't any log in docker container's log and terminal and server isn't run.
Here is my DockerFile
`
FROM node:lts
WORKDIR /var/www/html/app/
COPY package*.json ./
COPY . /app
RUN npm ci && npm cache clean --force
E... | How can i run vue3 "npm run dev" in docker? |
The Copy activity in Azure Data Factory v2 does have the ability to add extra columns such as variables and filepaths at run time. Use variables like$$FILEPATH:See the official docs for more info:https://learn.microsoft.com/en-us/azure/data-factory/copy-activity-overview#add-additional-columns-during-copy | I’m trying to create a pipeline on Azure data factory.
The pipeline pick up a file from azure file store and copies the data to a sql table. It works fine using a copy data task, but I want to include the name of the file in a column in the sql table.
Is this possible? | Azure Data Factory ADF data pipeline to include filename in copy data to sql databse |
Starting January 2020, you now have "a shortcut to compare across two releases":You can now compare tags between two releases – in order to determine what changes have been made – by clicking on theCompare ▾button for a given release.That give you a URL likehttps://github.com/go-gitea/gitea/compare/v1.11.0-rc1...releas... | Can someone recommend a comparison tool/add-on/ in GitHub. I'd like to see the code changes between two particular releases. It would be nice if it showed all the files that have changed and I could then drill down into each file of interest.This link:https://github.com/blog/612-introducing-github-compare-viewsaid th... | Comparison Tool in GitHub (compare releases, or shas if necessary) |
There are few things that i have noticed.If you just do,git add .
git commit -am "Message"Then it will say nothing to commit.I think you might have forgotgit push or git add command.Try again by doinggit add <files separated by space>
git commit -am "Clean push"
git push origin <branchname>also check if you are in corr... | FolksWhile commiting all my files to the remote github repository, I found the Android Git Commit/Push sucking some unwanted files(which I didn't want it to do). So I had to abort after all the checks completed (when it asked me "do you want to commit all these files").The problem: The local repository shows that all c... | Git help: Aborted git commit in Android, but changes are there in local not remote |
Wrap it by a table:local M={};
function detect_browser_platform(user_agent)
-- Here goes some string matching and similar stuff
return browser_platform
end
function detect_os_platform(user_agent)
-- Here goes some string matching and similar stuff
return os_platform
end
function detect_env_pattern(... | I have two simple functions that detects browser and operating system based on user agent and they are stored in fileuseragent.lua.function detect_browser_platform(user_agent)
-- Here goes some string matching and similar stuff
return browser_platform
end
function detect_os_platform(user_agent)
-- Here goe... | Why Lua+Nginx says it cannot call global function? |
Python requires no such flag (so, not really PyDev related).
Python (unlike java), will happily use all the memory you have available in your computer, so, in this case, your algorithm is really using up all the memory it can.
Note that if you are running a Python which is compiled in 32 bits, the max memory you'll ha... |
I'm working on indexing system and I need so much of ram, as I know in java we can pass some parameter to JVM to increase the heap size, but in python I couldn't figure out it how, and every time I run my application I get MemoryError after indexing ten thousands documents.
| Increase memory in Pydev using run configurations |
Message attributes are supposed to be used as message metadata (like timestamp or possibly some category) and not the message itself.
Ideally, message payload should be given in the message body
So, for example if you are supporting JSON and XML payloads then possibly you can put payload type as message attribute and... |
What is the purpose of using message body in SQS while you're already able to add message attributes?
Let's take an example, we want to push a message to new-user queue when a new user registered, I imagine the message will have an attribute userId, I don't see the use of body here.
| Purpose of Amazon SQS message's body as against message's attributes |
You can do it withKubernetes Python Client libraryas shown inthis question, posted byPradeep Padmanaban C, where he was looking for more effective way of doing it, but his example is actually the best what you can do to perform such operation as there is no specific method which would allow you just to count pods witho... | How can we obtain the gke pod counts running in the cluster? I found there are ways to get node count but we needed pod count as well. it will be better if we can use something with no logging needed in gcp operations. | GKE pod replica count in cluster |
I think the suggestion from Louis, using the the keys for locking is the most simple and practical one. Here is code some snippet, that, without the help of Guava libraries, illustrates the idea:
static locks[] = new Lock[ ... ];
static { /* initialize lock array */ }
int id;
void doSomething() {
final lock = locks... |
I'm using something like
Cache<Integer, Item> cache;
where the Items are independent of each other and look like
private static class Item {
private final int id;
... some mutable data
synchronized doSomething() {...}
synchronized doSomethingElse() {...}
}
The idea is to obtain the item from the cac... | Synchronizing on cached items |
If you are using Apache 2.2.16 or later, you can replace rewrite rules entirely with one single directive:FallbackResource /index.phpSeehttps://httpd.apache.org/docs/2.2/mod/mod_dir.html#fallbackresourceBasically, if a request were to cause an error 404, the fallback resource uri will be used to handle the request inst... | I have index.php that reads full path by$_SERVER[‘REQUEST_URI’]variable. My task is when user enter:www.domain/resource/777redirect toindex.phpwith path/resource/777and parse$_SERVER[‘REQUEST_URI’]to do some logic. But I have also real files and folders like:css/theme.cssassets/assets.jsresource/locale.jsWhen I try thi... | Apache redirect all to index.php except for existing files and folders |
23
You can run git rebase --abort to completely undo the rebase. Git will return you to your branch's state as it was before git rebase was called.
You can run git rebase --skip to completely skip the commit. That means that none of the changes introduced by the problemati... |
I'm trying to rebase the work of a colleague.
First, I get a ton of conflicts where <<<<< head seams to contain the new code.
Then after a while I get the following error:
fatal: update_ref failed for ref 'refs/heads/dev_504':
cannot lock ref 'refs/heads/dev_504': ref refs/heads/dev_504 is at
XXXXXXX
but expe... | Git rebase failing |
Answer recommended byWSO2CollectiveFirst, make sure all your WSO2 pods are running and they're in the ready state.kubectl get po -n <your_namespace>This should output.Then make sure you have enabled Ingress addon.minikube addons listThen make sure Ingress pods are running.kubectl get po -n ingress-nginxNext, get the In... | I'm trying to deploy WSO2 APIM on Kubernetes using the pattern-1 described on the github pagehttps://github.com/wso2/kubernetes-apim. I have added my minikube ip to my etc/hosts file as follows:[minikube ip] am.wso2.com gateway.am.wso2.comI'm unable to access the Publisher and Devportal using this url:https://am.wso2.c... | Unable to deploy WSO2 APIM in Minikube Kubernetes cluster |
The Data Protection API (DPAPI) does exactly what you want. It provides symmetric encryption of arbitrary data, using the credentials of the machine or (better) the user, as the encryption key. You don't have to worry about managing the keys; Windows takes care of that for you. If the user changes his password, Wind... | I need to store encrypted data (few small strings) between application runs. I do not want the user to provide a passphrase every time (s)he launches the application. I.e. after all it goes down to storing securely the encryption key(s).I was looking into RSACryptoServiceProvider and using PersistentKeyInCsp, but I'm n... | Persistent storage of encrypted data using .Net |
Prometheus is a metrics-based monitoring system, it cares about overall performance and behaviour - not individual requests.What you are looking for is a logs-based system, such as Graylog or the ELK stack. | I'm using Prometheus'Summarymetric to collect the latency of an API call. Instead of making an actual API call, I'm simply callingThread.sleep(1000)to simulate a 1 second api-call latency value -- this makes theSummaryhold a value of .01 (for 1 second of latency). But if, for example, I invokeThread.sleep(1000)twice ... | How to graph individual Summary metric instances in Prometheus? |
It is because your remote is still set to HTTP. You need to remove that origin and add the SSH origin to start using ssh.ShareFollowansweredJul 3, 2015 at 14:12TheGeorgeousTheGeorgeous4,02722 gold badges2121 silver badges3535 bronze badgesAdd a comment| | I havefollowed the stepsto configure ssh key for my git account.However I am still unsuccessful. Here is a transcript.[John@dev gitRepo]$ ssh -T[email protected]Hi JohnDoe! You've successfully authenticated, but GitHub does not provide shell access.
[John@dev gitRepo]$ git remote update
Fetching origin
Username for 'ht... | Configured SSH Key For Git But Still Unsuccessful |
You have to set up a.gitattributesfile, tag it asISO8859-1(easiest way is to just copy an existing text file that's tagged correctly - or usechtag) and then add the attributes for*.paxto be recognized as a binary file:*.pax binary | When I try to add files to a commit group I get an error.Command:git add .Error:fatal: src/python/files/mytest.pax added file untagged, set correct file taggit —version:git version 2.3.5_os390_b013Platform: z/OSThe problem here is double:I can be a tag in the USS in z/OS because when encoding of the files is different ... | git add fails with fatal: src/mytest.pax added file untagged, set correct file tag |
The best way to do, it is to write a small module.Here's the shortest:/**
* Implement hook_menu()
* to define path for our xml file.
*/
function mymodule_menu() {
$items = array();
$items['map.xml'] = array(
'title' => 'Map xml',
'page callback' => 'map_get_xml',
'access arguments' =>... | I'm usingammapto display a map. On click, the user gets a list of latest Drupal 6 nodes tagged with the respective country (taxonomy). The list is generated by a view. To accomplish that, I use the basic ammap XML code, but I added some PHP to include the view, i.e.:<?php
//set the working directory
chdir('..');
define... | How to cache a PHP generated XML file in Drupal? |
You can read all about it in thislinkBasically, my impression is that rkt takes pride in being image-agnostic (meaning you can run images that were built using docker or other container engines) and contain less overhead than docker does. This is a nice picture to describe the differences between the two (taken from th... | How are they functioning differently?
Which features of the kernel are they using? | What is the essential difference between docker and rkt? |
In your example, host port is 0, Azure will listen your service on a random port. You need open the port on NSG and lb.
I suggest you could specify the port, you could check the following example:
{
"id": "/dockercloud-hello-world",
"cmd": null,
"cpus": 0.1,
"mem": 32,
"disk": 0,
"instances": 1,
"accept... |
I have deployed a hello world application in Azure using DCOS and Marathon Framework.I am trying to access that using fqn: portnumber at which the application is hosted. I am unable to open the application
Following is the json I have used
{
"id": "/dockercloud-hello-world",
"cmd": null,
"cpus": 0.1,
"mem":... | unable to access helloworld App deployed using DCOS Marathon in Azure |
You cannot access a VPC Endpoint through Direct Connect private VIF without using proxies.
You can instead allocate a public VIF. When you enable route propagation in your VGW, AWS advertises all public routes to the customer's router, so all traffic towards AWS services in that region goes over Direct Connect.
A pu... |
Our setup:
we have a server on-premise, from which we want to send data to S3 (using AWS Java SDK)
our on-premise data center is connected to AWS using Direct Connect
on the AWS side, there is a VPC which does have a VPC Endpoint to S3
Our assumption is that everything is routed properly (on-premise can see the V... | Accessing the AWS S3 from on-premise world through Direct Connect, VPC and VPC Endpoint using AWS SDK |
I'm using grafana with Influxdb and I'm not using elasticsearch. | I’m trying to install grafana to work with OpenTSDB datasource. I’d like to know, what should I do to install it without elasticsearch? | Install grafana without elasticseach |
Hopefully, there's a good reason you don't want to precompile assets, but this should help.#{Rails.root}/config/environments/production.rb
config.serve_static_assets = trueBy default, Rails apps will not serve assets whenRails.env == "production". In dev/test environments, Rails will handle the request to assets/subfol... | I have a rails app with locomotive cms. I want to be able to reference specific css/js files through my CMS and have been able to in development using a URL like assets/subfolder/file.css. When I deployed my app to a server using nginx and unicorn those URLs no longer worked and all my images stopped loading. After add... | Nginx: Configure nginix for serving non precompiled assets in production |
The reason New knows how much memory to allocate is that New is compiler magic. It's a language built-in, so when the compiler sees you call it, it rewrites it to something like this:
// New(foo);
foo := System._New(SizeOf(foo^), TypeInfo(TypeOf(foo^)));
TypeOf here is a made-up Delphi function for expository purpose... |
I want to get the size of any "record" type in following function. But seems it doesn't work:
function GetDataSize(P : Pointer) : Integer;
begin
Result := SizeOf(P^); // **How to write the code?**
end;
For example, the size of following record is 8 bytes
SampleRecord = record
Age1 : Integer;
Age2 : Integer;
end;
... | Is it possible to get the size of the type that a pointer points to in Delphi 7? |
You might add it in your.gitattributefile as text.But identification as binary is not based on file name or extension. You should propably have a look on your cpp file and its encoding. There might be some special characters in, maybe non-printable. | I'm having a small problem with using the Windows client for Github. I have a file in my repository which is named "dllmain.cpp" for which it says, when I click on it, "This binary file has changed". So for some reason it detects it as a binary file instead of a code file, meaning it does not track the code changes.
... | Github Windows client detects cpp file as binary file |
I, too, have encountered this on active repos (particularly during Hacktoberfest).Direct AnswerTo answer your question, no, you can only push to a repository that someone has explicitly given you push access to.The fact that is a fork ofyourrepository is only tracked for informational purposes, since I can just as easi... | I am currently maintaining my first open source projects and I keep running into the same scenario.I get two Pull Requests within a few minutesBoth Pull Requests look great and don't conflict with the master branch. I want to merge them both into master.I merge the first Pull Request and works great.I go back to the se... | The right way to resolve pull request merge conflicts on Github from separate fork |
Bt default, Marionette will read the DOM element and run it through underscore's template() function to compile the html template into a simple JS function. This function is what goes in the template cache. Take a look at the annotated source code available on the marionette site to see how this works and where you c... | According to Derick Bailey in one of his posts ,Template Cache Built In To Backbone.MarionetteSo when i specify a template like thisBackbone.Marionette.ItemView.extend({template : '#template1'});Does it really store the templatetemplate1into template cache the first time and access it from cache subsequently?
I have ... | Backbone Marionette templateCache is not used by default? |
<div class="s-prose js-post-body" itemprop="text">
<p><strong>Update:</strong> As mentioned in below answers <kbd>Ctrl</kbd>+<kbd>p</kbd>, <kbd>Ctrl</kbd>+<kbd>q</kbd> will now turn interactive mode into daemon mode.</p>
<hr/>
<p>Well <kbd>Ctrl</kbd>+<kbd>C</kbd> (or <kbd>Ctrl</kbd>+<kbd>\</kbd>) should detach you from... | <div class="s-prose js-post-body" itemprop="text">
<p>In Docker 1.1.2 (latest), what's the correct way to detach from a container without stopping it?</p>
<p>So for example, if I try:</p>
<ul>
<li><code>docker run -i -t foo /bin/bash</code> or</li>
<li><code>docker attach foo</code> (for already running container)</li>... | Correct way to detach from a container without stopping it |
This can be a confusing subject. ECS tasks have two roles:The "Task Execution Role" which ECS uses for things like access to the ECR repository, and update load balancer targets, etc.The "Task Role" which the code running inside the ECS task can use to access AWS services.For boto3 running inside ECS, you will have to ... | I am running an ECS service with EC2 instances running Windows Server 2019 AMI/Docker - but when running the task which uses boto3, the logs showbotocore.exceptions.NoCredentialsError: Unable to locate credentialsTo my knowledge, the task's execution role is supposed to be provided to the container and boto3 is suppose... | AWS ECS - How to pass task's execution role to Boto3? |
http://code.google.com/p/django-cron/:) | I'm writing a database application where certain parts of the database might need updates based on time, not based upon user actions.For example, there may be certain values that are updated daily, and certain other values that must be updated say, four hours after the database entry is created.Thus I need some way to ... | Cronjobs in Django |
My answer could seem quite direct and valueless, but it is more for getting things together and to summarise.First thing, it that there is no "golden bullet" solution of this problem. Something definitely has to be changed and I see 3 options or 3 alternatives:RemoveSerializableinterface. It is not a "good practice" to... | Classes asLocalDateTimefrom the packagejava.timearevalue based classes. If I have an entity using such an object as a field I run into the following "problem":
Value based classes shouldn't be serialized. However, the JPA entity has to implement the interface Serializable. What is the solution for that paradox? Shouldn... | java.time and JPA |
It depends from your hardware
If this object is immutable, per requests, it's better to keep it in memory. If no - depends.
In any case workflow open connection to db - fetch data - return result - free data will consume more resources than caching in memory.
For example, in our project we processing high definition... |
Am developing a node js application, which reads a json list from a centralised db
List Object is around 1.2mb(if kept in txt file)
Requirement is like, data is to be refreshed every 24 hours, so i kept a cron job for it
Now after fetching data i keep it into a db(couchbase) which is locally running on my server
Data... | Node.js, store object in memory or database? |
Try installinggo-bindata:go get -u github.com/tmthrgd/go-bindata/...ShareFollowansweredMay 29, 2018 at 7:37Matías InsaurraldeMatías Insaurralde1,2021010 silver badges2323 bronze badges5I tried it and after I typed it, it closed my command line. After that tried again thatgo run mage.go dockercommand but still the same–... | I am usingpostgres_exporterforprometheus, and when I am trying to run it it shows me an error:Error: failed to run "go-bindata -pkg=assets -o assets/bindata.go -ignore=bindata.go -ignore=.*.map$ -prefix=assets/generated assets/generated/...: exec: "go-bindata": executable file not found in %PATH%"
exit status 1I real... | Error: mkdir ... The filename, directory name or volume label syntax is incorrect |
3
Damn, it was not loading sites-enabled because the nginx distro does not use this directory and when upgraded it replaced the nginx.conf
Share
Improve this answer
Follow
answered Jun 22, 2012 a... |
I recently upgraded (Debian) to nginx 1.2.1 and now it seems that nginx is always responding with the default server, even when it should not.
/etc/nginx/conf.d
server {
listen 80 default_server;
server_name _;
server_name_in_redirect off;
proxy_intercept_errors on;
return 401;
}
/etc/nginx/sites-enabled/searc... | Why nginx always responding with the default site even when it should now? |
My confusion was because the error message is actually coming from Docker, not Jenkins.Docker gives this error if you don't specify a build context (as noted in the docs above).The fix is just to add.to the end of the args parameter as per the example, eg:node {
docker.build("foo", "--build-arg x=y .")
}Seedocker: "b... | With this minimal Jenkins Pipeline scriptnode {
docker.build("foo", "--build-arg x=y")
}I'm getting a confusing error"docker build" requires exactly 1 argument(s).But as per the documentation, the signature ofdocker.build()isbuild(image[, args])(from Jenkins/job/dockerbug/pipeline-syntax/globals#docker)build(image[, ... | Jenkins Pipeline docker.build() gives error '"docker build" requires exactly 1 argument(s)' |
AStateSetteris a typedef for function signaturevoid Function(VoidCallback fn), andVoidCallbackis a typedef forvoid Function(), so basicallyStateSetter = void Function(void Function())It is just that IDEs usually resolve the typedefs to most primitive values, which is usually handy, but sometimes confusing as well. | The parameter forStatefulBuilder'sbuilder function are different in the websiteflutter.devand the documentation pop-up window inandroid studioorvs code. In official website documentation it says that the second parameter is aStateSetterwhereas inIDEit saysvoid Function(void Function ()).So, should I post it as an issu... | Should I post an issue for variation in parameters |
./entrypoint.sh: not foundmay be caused by the interpreter on line 1 not being found.This can happen if you for example have Windows line endings in the script while running in a unix environment.Try:dos2unix entrypoint.sh | I'm trying to set up a Docker container to run a shell script as its entry point.Here's my (simple) Dockerfile:FROM mcr.microsoft.com/dotnet/core/sdk:3.1.102 as base
WORKDIR /tests
COPY . .
RUN dotnet build -c Release
ARG CHECKSERVICES
ENV CHECKSERVICES ${CHECKSERVICES}
RUN chmod +x ./entrypoint.sh
ENTRYPOINT ["sh... | Docker: shell file "does not exist" when it blatantly does |
Simply fill in the following URLhttps://github.com/<USER>/<REPO>/commit/<HASH> | I have the commit hash but want to find that commit in github, I didn't found anyway on github page, anyone know how to do that ? I mean in github not git.Thanks | How to search commit in github |
Use following code:RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (mobile|android|blackberry|brew|cldc|docomo|htc|j2me|micromax|lg|midp|mot|motorola|netfront|nokia|obigo|openweb|opera.mini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|vodafone|wap|webos|windows.ce) [NC]
RewriteRule ^ - [E=IS... | I use mobile redirection code:HTACCESS MOBILE SITE REDIRECTION CODE
RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} (mobile|android|blackberry|brew|cldc|docomo|htc|j2me|micromax|lg|midp|mot|motorola|netfront|nokia|obigo|openweb|opera.mini|palm|psp|samsung|sanyo|sch|sonyericsson|symbian|symbos|teleca|up.browser|vodafon... | Specific .htaccess redirects |
For the records (in addition to my comment above):RewriteEngine On
RewriteRule ^([-0-9a-zA-Z]+)/([-0-9a-zA-Z]+)/?$ index.html?question=$1&qtitle=$2 [QSA]
RewriteRule ^([-0-9a-zA-Z]+)/?$ index.html?question=$1 | I am working on a htaccess URL rewriting assignment.
My actaul URL isblabla.comqid=1&qtitle=what-is-cssI have riwritten it using htaccess likeblabla.com/1/what-is-cssNow i am adding an another query string for sharing, the new URL must be likeblabla.com/1/what-is-css?share=asadas_45asd_asdasd-4744My current htaccess co... | htaccess is not working in an special case |
I think Migol wants to know how big the range of theRPC dynamic port allocationshould be.In the KB they mention a minimum of 100 portsFurthermore, previous experience shows
that a minimum of 100 ports should be
opened, because several system
services rely on these RPC ports to
communicate with each other.So I w... | I have a considerably large application that uses MSDTC. How many ports should I open? Is there any way to determine it?EDIT:I knowwhatports I need to open, I don't knowhow manyI need. | MSDTC - how many ports are needed |
Theexec_createappears when someone runs commanddocker exec... | I have a bunch of containers that are running using swarm. when i monitor thedocker eventsi see lots ofexec_create->exec_start->exec_dieevents whenever a HEALTHCHECK is run.However, the containers aren't restarted. The uptime is in days. I'm bit confused about how to interpret these events.Hope someone can point me to ... | exec_start, exec_die events happening frequently |
Even though you addedlocal.xmlto the.gitignorefile, Git will still track it and it will still appear in your change set when you typegit status. One way to get around this is to tell Git totemporarilyignore it from the index. You can do this via this command:git update-index --assume-unchanged local.xmlIf you ever wa... | I modified few files in my local git repo Ex:local.xml. Addedlocal.xmlto local .gitignore file .I want to keeplocal.xmlmodified in my local repo but remove from result when I dogit status(I thinks it's called index?).
It showsChanges not staged for commit:
modified: local.xmlandUntracked files: 17-08-2015/How ... | Git: Keep changes in local repo & remove from index after adding to .gitignore |
Thanks for all the answers. After a bit of struggle found out that the error message was not actually directly related to the docker cp command.
The scenario was, I ran the docker with the link to a local file. When the docker was running I deleted it. Then the file got created as a folder somehow (Probably, when I r... |
I am trying to copy file from docker to host using the below command,
docker cp <container_name>:<file FQN> ./
But getting the below error,
Error response from daemon: not a directory
As verified, the file name and container name are valid.
Note: Using Docker in Mac
| docker cp - "Error response from daemon: not a directory" |
The way you should handle this the kubernetes way is:kubectl delete secret <<secret name goes here>>ShareFolloweditedJan 19, 2021 at 14:35Tiago Simões41355 silver badges88 bronze badgesansweredJan 28, 2019 at 14:41Raunak JhawarRaunak Jhawar1,60111 gold badge1313 silver badges2222 bronze badges5This will remove the secr... | I have pod running my application. The pod also contains my secret. The secret mapped to/secret/mysecret.json. I connecting to my pod with ssh and try to remove the secret from this pod instance:rm /secret/mysecret.jsonI getting the Error:rm: cannot remove 'mysecret.json': Read-only file systemAccording tothis article,... | Kubernetes: Delete secret from pod |
Two clarifications to begin with:MySQL query cache is a server-side feature, there's no such thing as "local cache". You're probably confused by theLOCALkeyword inFLUSHcommand. Asdocsexplain it's just an alias forNO_WRITE_TO_BINLOG(thus it's related to replication and "local" means "this server").MySQL will only return... | I know that SQL query will use query cache to receive data instead of reprocess all of the data. Here the question I would like to ask,I working with a server of database and I'm one of the developer that working on it and I need to do performance testing on queries that i handlingIf I clear the query cache
example usi... | SQL Query Cache |
There isn't a portable solution to this, however there may be operating-system specific solutions for the environments you're interested in.
For example, with glibc on Linux, you can use the mallinfo() function from <malloc.h> which returns a struct mallinfo. The uordblks and hblkhd members of this structure contains... |
If I call:
char *myChar = (char *)malloc(sizeof(char));
I am likely to be using more than 1 byte of memory, because malloc is likely to be using some memory on its own to keep track of free blocks in the heap, and it may effectively cost me some memory by always aligning allocations along certain boundaries.
My quest... | How to find how much memory is actually used up by a malloc call? |
Looks likemailis not available for you to use or is not installed.Another option to consider is to using curl to send emails as described here:https://stackoverflow.com/a/16069786/280842Here's how you could implement this, using code from the link above:mail_alert.shfile contents#!/bin/bash
curl --url "smtps://smtp.gma... | I am trying to automatically backup my database from cPanel using a cronjob. I want to send the database to my email address when the cronjob is run and I have written code (below) but it is still not working.mysqldump -e --user=username --password='password' dbname | gzip | uuencode sql_backup.gz | mail[email protecte... | How to send MySQL backup to email with cronjob |
You need to mount ssh to get access under docker container.Try to add next few lines into your docker-compose.ymlvolumes:
- ~/.ssh:/root/.ssh:ro | In the Buildbot Docker tutorial documentation it says:"You will need to changedocker-compose.ymlthe variableBUILDBOT_CONFIG_URLin order to point to your github fork"But how would I do this if the URL points to a private repository accessible via SSH keys?I can't seem to find an environment variable to specify the BUILD... | Buildbot Docker BUILDBOT_CONFIG_URL how to setup with SSH keys? |
Thanks to @aztaroth, I did a bit of research onLC_CTYPEand found that the correct solution is to add this to the script:export LC_CTYPE="UTF-8"LC_CTYPEexpects a character encoding type, not a language charset. So setting it to UTF-8 fixed the problem.ShareFollowansweredMay 15, 2012 at 6:54Nik ReimanNik Reiman39.6k2929 ... | I've got a simpleshell script which synchronizes Google Calendarsfor quick local access. When I run it from the command line, events with non-ASCII characters (like ä, ö, å) work fine, and the generated output file looks perfect.However, when the script gets run from cron, the characters are mangled in the output files... | Why do non-ASCII characters get mangled when my shell script is run from cron? |
You'll have HTML5.0 with local database-like features. However what do you mean by secure? HTML5.0 will be secure against cross-site issues, but the user will still have full access to the data, I don't think encryption is required.
Google gears does fit, but its not a standard while HTML5.0 is, Safari supports 5.0, a... |
Note: this is a different problem to https - it's related to privacy security
I'm trying to figure out if there's a way to take load off our server [cache] by pushing information to the browser. Is there any technology that will provide secure caching that is bound to a session?
We have privacy-sensitive data that's ... | Is there a secure browser cache? |
0
I would split that up, save the requirement as event in some storage (redis for example or even rabbitmq) and listen to that with some daemonized script (cron would be a bad joice since its hard to make it run more often than every minute). The script will update the st... |
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve th... | How to enable php run python script on GPU? [closed] |
Following form comments: You load too much data.
Assuming ARGB images:
width x height x images x colordept = bytes used
450 * 420 * 20 * 4 = 30240000.
That's 14 MiB when you load the full animation. This is guaranteed to blow up your ram.
|
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 10 years ago.
Improve t... | Out of memory issues with AnimationDrawable [closed] |
If you installed ruby via rvm, ruby probably isn't in /usr/bin. Depending on where rvm is installed:bash -c "source /usr/local/lib/rvm" && rails runner foo.barYou probably added a source*/rvm to your bashrc that is the correct rvm loading script.ShareFollowansweredMar 9, 2011 at 5:13drewrobbdrewrobb1,5941010 silver bad... | I have install ruby by rvm (system-wide), and worked correctly via normal console and my rails program is behaving correctly with bothrails runnerandapache2+passenger.Now in a crontab, I calledrails runner foo.bar, it gives up, carefully examine the log i see that:/usr/bin/env: ruby: No such file or directoryAnyone kno... | why #!/usr/bin/env ruby doesn't work in crontab? |
You could add a new remote which tracks the project you forked from, which is a good idea anyway if you plan to reintegrate your changes or keep the projects in sync, and then start the branch from their master.
git remote add upstream <original-project-url>
git fetch upstream
git branch <branchname> upstream/master
... |
I have forked a project on Github and cloned it on my local machine. I created some new files and directories in the master branch. The problem is I want a new branch with only the files from the forked project not the files added in the branch master.
| Copy fork repository to a local branch |
You should probably increase the memory allocated to the program. What is the-mxvalue you pass to Java?-Xmssets the initial memory, whereas-mx(or-Xmx) sets the maximum memory. My guess would be that for a corpus of 500MB, this has to be a very large value -- at minimum a few 10GB, and possibly more. On top of that, I h... | I'm trying to use stanford-ner.jar to train on a relatively large corpus (504MB) and even though I use the option of -Xms1g and -Xms1g there's still memory issues. And what's horrible (I assume) is the output, when I tried to train a small model, the output is like:[1000][2000]numFeatures = 215032However, the staff I g... | Stanford ner java.lang.OutofMemory issue and interpretations of the outputs |
As KIMB-technologies pointed out in his previousanswerto this question, whitespace causes this problem. If you cannot find any visible whitespace at the beginning of any of your PHP files, there might be an invisible whitespace on them, though.Sometimes the UTF-8 BOM (Byte Order Mark) is present on some files. It is in... | I want to create a custom 404 page but it won't send the 404 Header, it still send's 200 OK..htaccessMy .htaccess redirects every request to index.php.RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ /index.php [NC,L]index.phpThe index.php handles the url with inclu... | Send 404 header via PHP after .htaccess redirect |
Made a helper that leverages @cornr answer:extension Error {
/// Returns a custom description for the error if available, otherwise `localizedDescription`
var customDescription: String {
let ns = self as NSError
// AWS Errors
if ns.domain == AWSCognitoIdentityProviderErrorDomain, let co... | I am developing an iOS app in Swift using AWS Cognito to handle user login and registration. I've found that when users do something that Cognito doesn't allow (entering the wrong username/password on login, trying to create a password that doesn't match the requirements, etc.) the app will display error messages such ... | Getting descriptive login error messages in iOS app using AWS Cognito |
You should take a look at Redmine (http://www.redmine.org/). It has all of the features you mention and more. You can host it on your own vps (I do).ShareFollowansweredMar 8, 2009 at 15:15Michael LarocqueMichael Larocque1,16611 gold badge66 silver badges66 bronze badges2The only downside for me is the Wiki syntax in Re... | In the past I have really enjoyed usingTracwith subversion repositories hosted on some of my own servers. The integrated ticketing and online code browsing is very convenient.I have usedgithubfor some of my public projects but I don't have the money to shell out for an extra service, espcially when I am already paying... | Git and Trac (or similar) |
Helm provides the--create-namespaceswitch that will create the namespace of the release if it does not already exist.The secret can be added in your helm chart and you can pass the variables (CI_REGISTRY,CI_DEPLOY_USER, etc.) in as helm chart values either as--setvalues or via thevalues.yamlfile and using--valuesThe se... | In my CI I'm running ahelm upgradecommand to release an app.
But if it is a non existing app, I have to create the namespace, a secret and patch the serviceaccount. So I come up with this:kubectl create namespace ${namespace} --dry-run=client -o yaml | kubectl apply -f -
kubectl create secret docker-registry gitlab-reg... | Create namespace and secret, do patch only if not existing |
Your front-end vue.js application is just hosted in the container. The application is actually run from the browser of the client. Your backend which functions as the API will also need to be accessible to the browser of the client. The communication between frontend and backend doesn’t go through the container of the... |
I have built a front-end Vue.js application, running on a docker container under kubernetes environment. the backend is also in the same kubernetes cluster (I am using Minikube for the project). When running it gets error net::ERR_NAME_NOT_RESOLVED when connecting to back-end containers:
while inside the container, t... | front-end Vue.js app in Kubernetes docker container cannot connect to back-end |
The only way I was able to do this was to chainFn::Ifstatements instead of using the map. I tried using a combination ofFn::IfandFn::FindInMapbutFn::FindInMapwill always raise an error it if can't find the mapping.Therefore the only solution for me was to resort to using something like the following (for me it was sett... | What would be a good strategy to have a default value on mappings?I.E.I have a parameter calledcountryBased on thatcountryI reference a DNS using mappings"Mappings" : {
"DNS":{
"us" : {"dns" : "mypage.us.com", "ttl" : "600"},
"mx" : {"dns" : "mypage.default.com", "ttl" : "300"},
"ar" : {"dns" : "mypag... | Default value on mappings AWS CloudFormation |
One way you can check is from inside the WSL2 environment with standard Linux commands. See which WSL environments you have by running this in Powershell: wslconfig /list and if you have WSL2 properly configured, you can access the shell with wsl also in Powershell.
$ free -mh
total used fr... |
I want to increase allocated RAM for WSL. I have created in my root /users/ .wslconfig. How does it looks:
[wsl2]
memory=6GB
swap=0
localhostForwarding=true
I did wsl --shutdown and then started WSL to apply changes.
But I don't know how to check if allocated RAM is changed. How do I check it?
| How to check allocated memory for WSL Docker? |
If you look at the Sprocketssource, you can see that ifcache_classesis true thenapp.assetsgets set toapp.assets.index, and the filesystem is no longer checked.In order to get around this in development, you can add something similar to thefollowingto yourdevelopment.rbconfiguration:# Sprockets configuration: prevent sp... | Another question "Disable Sprockets asset caching in development" addresses how to disable Sprockets caching in Rails 3.2. How do you do the same thing on Rails 4? I am working on a gem that is deep in the asset pipeline and having to cleartmp/cache/*and restart Rails is getting tiring. | Disable Sprockets asset caching in development on Rails 4 |
$ kubectl get ns
$ kubectl describe nsAlso, you can usekubensto list and switch namespaces (on your localKUBECONFIG)$ kubens | I am trying to figure out how to list all namespaces in a cluster:https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/something like:kubectl describe cluster --namepaces -o jsonanyone know how to list all the namespaces in a K8S/EKS cluster? | How to list all namespaces in a cluster? |
Though I can't test this myself I'm guessing maybe this will workRewriteRule ^e-books/([0-9]{4}-.*)$ artigos/$1 [NC,R,L]It's looking fore-booksfollowed by a/Start of a 'memory block'(
[0-9]any number{4}four times-a dash.*Everything remaining on the line.)Close 'memory block'ShareFolloweditedFeb 19, 2016 at 15:18answer... | I need to replace:https://www.domain.com/e-books/6002-XXXetcXXXBy:https://www.domain.com/artigos/6002-XXXetcXXXBut not:https://www.domain.com/e-books/XXXetcXXXThat is, only the urls that beggins withe-books followed by a slash and 4 digitsI tried:RewriteRule ^e-books/(.+)/?$ /artigos/$1 [NC,R,L]And:RewriteRule ^e-books... | Regex redirect URL after word, slash, 4 digits in .htaccess |
I finally used mod_wsgi to solve my problem. | I am trying to setup a Django project likeexplained on AlwaysData, but on my own computer.I'm using ArchLinux.I got an access denied in my error_log when I went to the directory containing the FastCGI script (the same django.fcgi as in the link above) :client denied by server configuration: /var/www/homeHowever, I can ... | Access denied in Apache using Django |
Solved problem by usingMulti-Domain (SAN) Certificate.makecert.exeis unableto generate SAN Certificate.at least i can't find out how.UsedOpenSSLto generate SAN Certificate and it worked.OpenSSL PKI Tutorialis good resource to know how generate SAN Certificate. | Generate self-signedroot certificateusingmakecert.exeand imported inTrusted Root Certification Authorities.Since, Mozilla Firefoxhas it own list of Certification Authority (CA) certificates,
imported self-signed certificate into Firefox's Authority certificates list.Generate derived certificate withCN=*.test.comSetup ... | Self-signed wilcard certificate not working for Firefox |
Windows Server Backup Featuremight be a good alternative to custom built solutions. If you are running Windows Server 2016 you may find thisarticleexplaining the new features interesting too. | Is there a way in .NET to backup a directory containing multiple sub directories each containing potentially 10,000 or more files of roughly 100kb-500kb in size without enumerating? The use case here is incrementally backing up files to USB storage and a NAS, but due to file count, it can take a really long time. I'm f... | Backup large number of files without enumerating |
Easiest thing to do is install GNU cp. The easiest way to do that is installHomebrew:ruby -e \
"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install coreutilsThen you can usegcpinstead ofcpwhenever you need features not in the BSD cp that's part of OS X, e.g.gcp --backup. | I'm looking to backup a file. If the file exists in backup form, I'm looking to create a new version of that filename so as not to overwrite the previous backup.I believe:cp -b ~/.profile ~/
cp --backup ~/.profile ~/is exactly what I need. However these options aren't available on a mac. Does anyone know if a substi... | cp: illegal option -- b on mac |
This is impossible to do with PromQL, but is possible withMetricsQL. For instance, the following query would return increasing graph starting from 0 fornode_network_receive_bytes_totalmetric:with (q = remove_resets(node_network_receive_bytes_total)) q - range_first(q)The query uses the following MetricsQL features:With... | In grafana, with data source prometheus, I want to show the evolution of a counter starting from 0 to see the number of [x] (for example written_bytes) increase during the shown range, I want to see how it increases over time, so survive system restarts and no showing the rate().For example, if I select 2 hours in the ... | Substract first value of the range to show 0 based counter |
Hey finally I got the solution the problem was in rails file in script director.
Make sure this file starts with this line :- #!/usr/bin/env ruby
and in my file in the starting there was just a blank space and then this line was present.Remove that space and now everything is working fine :)ShareFollowansweredJan 30, 2... | I am using whenever(whenever (0.8.2)) in my rails project('rails', '3.2.11'). Everything that is given in the readme of the whenever is present in my schedule.rb but when i try to use cron job during execution it don't complete but gives me some error in my error.log file:-Error:-syntax error near unexpected token `('
... | syntax error near unexpected token `(' |
There may be different reasons not to map to same port on host: doing this allows to have multiple Postgres running on separate ports and tweak them in case for some reason you want different ports in DEV/PROD.
|
I'm new to docker and wondering why so many examples of docker-compose map ports from internal to external instead of just keeping them the same. For example, one postgres example I saw mapped 4612:5432.
Is there a reason people don't just keep it 5432:5432?
| Docker: Internal Ports |
I saw this still here so I figured I might as well answer the question. So the answer is YES. It will remove the contributions from the graph. It won't do it right away because commits that are no longer being pointed to by anything can technically still be reached for awhile but are eventually garbage collected and th... | For some projects I do or work on sometimes it is usually best that we squash/rebase all changes into a single commit. However, I was wondering how this affects the contributions page on github.For example, if I spent 2 months pushing changes to a project I created and then after 2 months decided to rebase it to one si... | How does squashing, rebasing, reset --soft affect github contributions page? |
I faced similar issues many times. I would suggest to raise aPRand in files changed tab it will only show your changes. I have had similar problem but it works perfect when you raise a PR. | I'm not new, but still struggling with git. in particular merge vs. rebase. the current result is that when i go to github.com to look at my feature branch (last commit) , it tells me that 152 files were changed, with 6,099 additions.... I'd estimate more like 30 files. And indeed, the changes shown are certainly n... | git showing more files changed than i touched |
0
Set up the cache as per the cache-persist example here:
Then, pass it as a custom cache in the boost configuration, as shown in the cache configuration section here:
For example:
import { InMemoryCache } from 'apollo-cache-inmemory';
import { persistCache } from 'apollo... |
I've got a quick question.
How can we persist the cache using apollo-boost lib?
I am not sure how to implement apollo-cache-persist with the following config.
const client = new ApolloClient({
uri: 'http://localhost:8080/_/service/com.suppliers/graphql',
clientState: {
defaults: {
networkStatus: {
... | Persist cache with apollo-boost |
15
You can use the entrypoint to run the startup script. In the entrypoint you can specify your custom script, and then run catlina.sh.
Example:
ENTRYPOINT "bin/startup.sh && catalina.sh run"
This will run your startup script and then start your tomcat server, and it won't... |
I have built my docker image using openjdk.
# config Dockerfile
FROM openjdk:8
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp
# build image
docker build -t shantanuo/dbt .
It is working as expected using this command...
docker run -p 8081:8080 -it shantanuo/dbt
Once I log-in, I have to run this command...
sh bin/sta... | adding startup script to dockerfile |
In few words: you can't.Check out tools likeValgrindto help you debugging memory leaks issues.Some other things you should consider:Use smart pointers so that you don't have do think about memory management,Set your pointers to 0 after you free them, so that a furtherdeletehas no effect,Use standard classes (vector, ..... | How to check if memory to which pointer p points has been succesfully deallocated? | How to check deallocation of memory |
You can not set a name on the instances of docker that manages amazon. The namespaces it uses are to be able to handle the scaling of the service. Think that if you write the name and then the service you ask for more than one instance of your application, amazon could not instantiate it on the same node.
I hope the e... |
Is there a way to name containers when they start through ECS? Wondering because I'm currently using Datadog to monitor the system usage and the containers are named something long etc like
ecs-datadog-agent-task-1-datadog-agent-c0a1f3e8d9e58dd5e901
would like to set my own name
| Naming Docker Containers on start ECS |
1)General idea: Docker it is not Vagrant. It is wrong to put two different services into one container! Split it into two different images and link them together. Don't do this shitty image.Check and followhttps://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/Avoid installing unnecessary packages... | I run Docker 1.8.1 in OSX 10.11 via an local docker-machine VM.I have the following docker-compose.yml:web:
build: docker/web
ports:
- 80:80
- 8080:8080
volumes:
- $PWD/cms:/srv/cmsMy Dockerfile looks like this:FROM alpine
# install nginx and php
RUN apk add --update \
nginx \
... | Wrong permissions in volume in Docker container |
If you want to restrict CPU/memory, using labels on nodes is not the right way to do this. Instead, set a quota on the dev/test namespace.https://kubernetes.io/docs/concepts/policy/resource-quotas/Basically, it would look something like thisapiVersion: v1
kind: ResourceQuota
metadata:
name: low-priority
spec:... | I have the standard 3-nodes pool in GKE.I want to label 1 of these nodes to be something likedevortest, so all the pods in the namespacedev,qaorstageare loaded in that node, preferrably.The pods in the namespaceprodwould use the other available nodes, be it 2, 3 or more nodes available.Basically I want to restrict the ... | How to tag nodes in GKE, then assign pods to nodes? |
Remove credentials, but not from Keychain as they are not stored there, but from filesystem, as written here:
https://eekayonline.medium.com/connecting-mac-sourcetree-with-your-github-account-b6b3bb3c5a66
home directory > Library > Application Support > Sourcetree
|
Even though I create a PET in GitHub, and I set it in Sourcetree, it does get user, or updated.
Cloning a repo will result the same issue. Why? Should I remove the cache, or what?
| Support for password authentication was removed on August 13, 2021. Please use a personal access token instead |
What you have essentially done is told the compiler to treat the p_buffer pointer value as though it was a pointer to your struct, but in doing so no extra memory was allocated. The same memory is being looked at - just with a different interpretation.
If you wish to keep the header you could do either this:
ETHER_HD... |
I have defined this struct :
typedef struct ethernet_header
{
UCHAR m_dest[6];
UCHAR m_source[6];
USHORT m_type;
} ETHER_HDR;
Then I used it in a function like this :
void SniffPacket(u_char* p_buffer, int p_size)
{
//Ethernet header
ETHER_HDR *l_ethHeader = (ETHER_HDR *)p_uffer;
//Do Somet... | How to safely delete a struct |
33
When you get the Access Token, ID and Refresh token from Cognito User Pools, you must cache it locally. The Access and the ID token are valid for 1 hour and should be reused as much as possible within that time period.
These tokens are JWT tokens and hold the expiry ti... |
I am developing an application that uses AWS Cognito as the Identity Provider. So the user authenticate on AWS Cognito Pool and get the Access Token, Access ID and Refresh token.
Then the user can make backend requests to my app. I get the Access Token validate it, get the user profile on Cognito AWS and authorize th... | How to handle with token expiration on Cognito |
Note that a lot of non-embedded programs without an infinite loop also don't call free, they just call exit, and rely on the OS resource tracking mechanism, but such code has to be reworked if reused in a library, so bad practice here.
But on embedded systems, it's perfecly okay to allocate memory, then start the main... |
Alright, I am quite the beginner at C, so I might not understand everything yet, so here I go:
We need to program a stm32f0 using c without any hal libraries. For an exercise, we needed to change the example usart code from sequential to interrupt driven (for the receiving part). Now that wasn't too difficult. Another... | A free() needed after malloc on mcu (even when the array/pointer is always in use)? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.