Response stringlengths 15 2k | Instruction stringlengths 37 2k | Prompt stringlengths 14 160 |
|---|---|---|
If you forego verifying your HTTPS requests, then you have no way to verify that you're not a victim of aMan-In-The-Middle attack(and possibly other attacks). In effect, it would be equivalent to making an HTTP request (rather than HTTPS) in terms of security. If the data you're dealing with is not important, then that... | I am new to python programming. Can anybody please tell if there will be any problem in fetching data from the web if I don't use certifi or any sort of certificate verification while using urllib3? I am getting warnings regarding the authenticity but data is fetched regardless of that. I was just wondering, if there i... | Using certifi in urllib3 |
The issue is caused by the fact, that VirtualBox and also the quickstart docker toolbox must be run in the Windows administrative mode, in order for the VirtualBox to be able to create symlinks. | Yii 2 starter kit inside VirtualBox docker toolbox on Ms Windows -symlink(): Protocol errorwhen opening the Yii2 starter kit website inside a Docker Toolbox - VirtualBox, following the exact Yii2 starter kit documentation. | Yii 2 starter kit inside VirtualBox docker toolbox - symlink(): Protocol error |
The name is a metadata, not a label in the example.Try the following:kubectl get pods -l app=redis,role=master -o wideShareFollowansweredJun 29, 2016 at 6:34manojldsmanojlds295k6464 gold badges477477 silver badges423423 bronze badgesAdd a comment| | I have been following tutorial athttps://cloud.google.com/container-engine/docs/tutorials/guestbook#step_four_create_the_redis_worker_serviceAfter creating a pod (redis pod), when I tried to get the nodeusing the folloiwng command$ kubectl get pods -l name=redis-master -o wideI don't see any output. It is just blank | List node of kubectl pod |
According to the OWASP, injection flaws are one of the top application security risks (link). The basic prevention idea includes automatic validation of all input values using thewhitelistapproach. In order to implement it in Java EE, OWASP suggests using a custom filter, you can find more details with some restrictive... | The SonarQube hint (rule "Web applications should use validation filters") suggests this compliant solution:public class ValidatingHttpRequest extends HttpServletRequestWrapper {
// ...
}
public class ValidationFilter implements javax.servlet.Filter {
public void doFilter(ServletRequest request, ServletResponse re... | SonarQube Critical Violation asks for filter on rest api web.xml file |
There is no concept of a directory in S3. Here is a crude way of achieving what you want. Other posters may have a better solution. The following solution first gets all the objects in the folder and then calls put-object-tagging for each one of them. Note: I didn't test this solution.
aws s3api list-objects --bucket ... |
Is there a way to apply a tag (or set of tags) to all objects in an S3 directory using one single put-object-tagging cli command?
I.e if I have two files (test0.txt, test.txt) I can do the run the following two commands:
>aws s3api put-object-tagging --bucket mybucket --key foo/bar/test0.txt --tagging 'TagSet=[{Key=c... | AWS S3 cli - tag all objects within a directory |
In order to understand what constitutes an image, you need to look at a Dockerfile in a different way:Every step (with the exception ofFROM) creates a new image, with the results of the previous step as a base.FROMdoesn't use the previous step, but an explicitly specified one.Now, looking at your Dockerfile, you seem t... | I have below docker image, where I need to update patch to curl package, in below Docker image, in Line number 3 I am already doing update, but it is shown up in Vulnerabilities report.I have added, RUN yum -y update curl at the end of Dockerfile, then it is not showing up in Vulnerabilities report.Any fix?, All Packag... | Docker image Package Patch within Dockerfile |
My bad... It turns out VS had changed the DataContext connection string to DTZConnectionString1 and made another settings file. Now I am using the correct connection string it is working fine.
No idea why the incorrect one worked in debug but not release.
|
I have a small c# wpf app for doing some simple calculations running off a Sql Express 2008 R2 db, and in the setup section is a backup button that runs the code
using (DTZDataContext db = new DTZDataContext())
{
db.ExecuteCommand(string.Format("BACKUP DATABASE DtzDb... | DB Backup runs in Debug but not Release |
5
I was getting this same error when working on EC2 instance installing Rails with Capistrano and nginx
if you are getting 502 error Add install_plugin Capistrano::Puma into your Capfile after require 'capistrano/puma'.
Share
Improve this answer
... |
I am getting the following error in the nginx error logs after deploying production a ruby on rails project through capistrano to an instance on ec2. The amazon public host shows a 502 Bad Gateway nginx/1.10.0 (Ubuntu).
I followed the tutorial from https://www.sitepoint.com/deploy-your-rails-app-to-aws/
It seems the p... | puma.sock missing in ec2 server after capistrano deployment |
If it's a constant, that implies that it shouldn't be deleted, because it wasn't allocated: the caller could easily have passed a stack-based array to your method, and freeing it would be a bad thing.
The most common convention is that whatever code allocates some data should free the data. It's really not your routin... |
Given the next code example, I'm unable to free the parameter const char* expression:
// removes whitespace from a characterarray
char* removewhitespace(const char* expression, int length)
{
int i = 0, j = 0;
char* filtered;
filtered = (char*)malloc(sizeof(char) * length);
while(*(expression + i) != '\... | const char* and free() |
Technical answer: The memory is freed when the AppDomain is unloaded or the process is shut down.
Better answer: The memory is freed whenever the GC decides to free it. You don't know and aren't supposed to care. If your Singleton is tracking unmanaged resources (i.e. file handles, GDI handles, anything other than m... |
if we use singleton pattern in our web application, when free the specified memory that allocated to our class?
| Memory allocation for singleton pattern |
0
I think that your workers should really vary on how much CPU Cores you have since that is where the threading starts. Like right now I have an 8 core server which means that I also have 8 workers to evenly distribute the workload for my Django App, that really works.
... |
we now that both gunicorn and nginx has wokers.
When using nginx+gunicorn to deploy a django app on a vps.
What is the best value for number of workers in gunicorn and nginx? should they be equal? or with any special ratio?
I've followed the formula : n_workers = 2*cpu_cores + 1 for both. but my server load became v... | nginx and gunicorn number of workers |
Here a simple function that adds caching to getting some URL contents:
function getJson($url) {
// cache files are created like cache/abcdef123456...
$cacheFile = 'cache' . DIRECTORY_SEPARATOR . md5($url);
if (file_exists($cacheFile)) {
$fh = fopen($cacheFile, 'r');
$size = filesize($cache... |
Got a slight bit of an issue. Been playing with the facebook and twitter API's and getting the JSON output of status search queries no problem, however I've read up further and realised that I could end up being "rate limited" as quoted from the documentation.
I was wondering is it easy to cache the JSON output each h... | Caching JSON output in PHP |
You won't be to see the PR from the original "upstream" repo in your fork, but you still can import them in your local clone:git remote add upstream /url/of/original/repo
git config remote.origin.fetch "+refs/pull/*/head:refs/remotes/upstream/pr/*"(Thepull/IDbranch naming convention is mentioned in the GitHub help page... | I am working on this code :https://github.com/samvermette/SVPullToRefreshThis have many pull request pending. But due to some reason Author is not able to accept.So I decide to Fork project and accept some of the request which can improve code.But when Ifork projectI don't get all that Pull request in Forked copy.Is th... | Github : Fork with pull requests |
Sure. You can use thedocker inspectcommand on the image. For example:$ docker inspect postgres
[...]
"Volumes": {
"/var/lib/postgresql/data": {}
},
[...]If you want to avoid all the other output, you can use:$ docker inspect --format '{{.ContainerConfig.Volumes}}' postgres
map[/var/lib/pos... | This question asks about listing volumes in containers.But what I'm looking for here is, how do you find volumes configured into animageitself, without creating a container first?The idea is, I want to know what an image might do with volumes mapped to the host file system, before allowing a container to run from that ... | How do you find volumes configured into the docker *image* itself? |
Usefopen,freadandfcloseto read a file sequentially:$handle = fopen($filename, 'r');
if ($handle) {
while (!feof($handle)) {
echo fread($handle, 8192);
}
fclose($handle);
} | I am reading a file containing around 50k lines using the file() function in Php. However, its giving a out of memory error since the contents of the file are stored in the memory as an array. Is there any other way?Also, the lengths of the lines stored are variable.Here's the code. Also the file is 700kB not mB.privat... | Fatal Error - Out of Memory while reading a *.dat file in php [duplicate] |
That is correct. Since you are initializing the object, it is your responsibility to release or autorelease it.
As the retain count on creation is 1 and you want it to not be deleted before the calling method has a chance to use the object, autorelease is the correct message to send.
If you had sent it release, the me... |
When you allocate and initialize and object, and then want to return that object, how are you supposed to return it?
I have the following code:
NSXMLDocument* fmdoc = [[NSXMLDocument alloc] initWithContentsOfURL:trackInfoUrl
options:NSXMLDocumentTidyXML error:&err];
return [fmdoc autorelease];
Is this correct?
| Objective-C memory management (alloc and autorelease) |
1
Oracle bug-database states that: Underscore is not a valid character in a hostname according to RFC 2396, RFC 952, and RFC 1123. Please refer this below link:
http://bugs.java.com/bugdatabase/view_bug.do?bug_id=5049974
Better idea could be to replace underscore with hypen... |
We use rancher template for hadoop+yarn, but it seems that hadoop is unable to deal with using container names as hostnames (eg. hadoop_namenode-primary_1).
Caused by: java.net.URISyntaxException: Illegal character in hostname at index 13: http://hadoop_datanode_1:50075/webhdfs/v1/skystore/tmp/devtest_onedir/2016_08_1... | Rancher template - Hadoop Illegal character in host-name |
-2There was a problem in pdns-recursor config.So, you need write your real IP address OR 0.0.0.0 instead of 127.0.0.1 in
local-address property.ShareFollowansweredSep 15, 2015 at 15:54Kirill BurkhanovKirill Burkhanov4177 bronze badgesAdd a comment| | So. The PowerDNS 3.3 as salve works only on local.
(Also there is a nginx which works fine)This work gooddig example.com A @127.0.0.1But this not (slave server)dig example.com A @ns2.example.com
;; global options: +cmd
;; connection timed out; no servers could be reachedI've tried with IP of ns2.example.com, but no goo... | PowerDNS works only on local |
This blog answered the question for me;http://weblogs.asp.net/jeff/archive/2009/07/01/304-your-images-from-a-database.aspxBasically, you need to read the request header, compare the last modified dates and return 304 if they match, otherwise return the image (with a 200 status) and set the cache headers appropriately.C... | As you may know we have got a newActionResultcalledFileResultin RC1 version of ASP.NET MVC.Using that, your action methods can return image to browser dynamically. Something like this:public ActionResult DisplayPhoto(int id)
{
Photo photo = GetPhotoFromDatabase(id);
return File(photo.Content, photo.ContentType);
... | How return 304 status with FileResult in ASP.NET MVC RC1 |
+50The functionSSL_CTX_get_cert_store()can be used to get a handle to the certificate store used for verification (X509_STORE *), and theX509_STORE_add_cert()function (inopenssl/x509_vfy.h) can then be used to add a certificate directly to that certificate store. | I am using OpenSSL to verify a server's certificate. Since OpenSSL is shipped without any built-in root CAs, we must distribute the root CA certificate ourselves with our software (we statically-link OpenSSL). Ordinarily, the way to do this is to distribute a certificate file in PEM format and call SSL_CTX_load_verif... | C++/OpenSSL: Use root CA from buffer rather than file (SSL_CTX_load_verify_locations) |
So it seems ThePHPLeague Flysystem major version got updated (to v2) thus breaking a lot of stuff since latest Laravel depends on "^1.1" (see:https://github.com/laravel/framework/blob/8.x/composer.json#L27).I've had this error, so my workaround is to use a specific version instead.Go to composer.json and use latest v1 ... | I have installed the s3 flysystem package by running the following composer command in myLaravel 8projectcomposer require --with-all-dependencies league/flysystem-aws-s3-v3 "^1.0"and tried to store a file from the request as$imageName = $request->file('file')->store('uploads');I got the following errorLeague\Flysystem\... | League\\Flysystem\\AwsS3v3\\AwsS3Adapter::__construct(): Argument #1 ($client) must be of type Aws\\S3Client, Aws\\S3\\S3Client given |
You can usedynamic blocks. The condition depends exactly on what is your condition (var.stateis not shown, so I don't know what it is), but in general you can do:data "aws_ami" "my_ami" {
filter {
name = "name"
values = ["my_ami_name"]
}
dynamic "filter" {
for_each = var.state ? [1] : []
conte... | Given the data source definition:data "aws_ami" "my_ami" {
filter {
name = "name"
values = ["my_ami_name"]
}
}How does one add a second filter only if a condition is true?Example pseudo code of what I want:data "aws_ami" "my_ami" {
filter {
name = "name"
values = ["my_ami_name"]
}
var.stat... | Terraform: How to add a filter to a data source conditionally |
First, you need to:git pull origin masterto bring in changes from the server.Then,git push origin masterwill work.This is because you created a repositorywith a readme fileand did agit initin your local copy instead of aclone.Creating a readme file causes github to create a repository but then also push the readme to t... | I have installed Git on my server and have successfully connected to Github.
I now want to download my website (that has already been developed) to Github in order to start version tracking. However, I am having a problem doing this.I have signed up with Github and created a blank repository with a readme file.I have l... | Initial download of website into github |
+50Datadog has two agents.Cluster agent which is a proxy between Kubernetes API Server and Datadog node agents. The cluster agent is deployed as deployment to one of the kubernetes node.Node agents which is deployed in each and every Kubernetes node as Daemonset.And yes for DogStatsD the node agents need to be deployed... | I have been working with Datadog log ingestion for about a year now. It's been (mostly) great to work with. The documentation around running it inside of Kubernetes is a bit lacking though. Their documentation covers Docker thoroughly, but Kubernetes less so.When I installed Datadog into our Kubernetes clusters a year ... | Proper Setup of Datadog Log Ingestion on Kubernetes |
The issue is that in the default nginx config it only uses the index directive. What you need is the try_files directive which will first try the uri then it will go to the index.html
To do this you need to pass in your own default virtual host config. Something like the following should work. This is based on Nginx's... |
I have an angular 4 SPA app and I'am using docker for production. Looks fine so far. Via terminal I go to /dist folder and from there I let docker point to the content of dist with the following command:
docker run -d -p 9090:80 -v $(pwd):/usr/share/nginx/html nginx:alpine
I call: localhost:9090 on the browser and can... | How to work around the 404 error on nginx? |
Well, you can use following format.https://github.com/<repos_name>.wiki.gitSo In your case:https://github.com/reggi.wiki.gitHope to help you. | I want to have a wiki-only github repo. But I want to have the master branch of the repo actually be the wiki repo itself.It seems I can clone the wiki like this:https://github.com/reggi/wiki.wiki.gitAnd the repo with these urls:https://github.com/reggi/wiki.git[email protected]:reggi/wiki.gitIs there any way to have t... | Mirror / Duplicate Github Wiki to the repo |
There are several ways
git checkout
Using git checkout <branch> you "change" the content of your folder to reflect the files in the desired branch. Your "root" folder can contain content from a single branch every time
git worktree
# Add "another" directory for a different branch
git worktree add <second path>/<branc... |
I am learning to use GitHub.
I want to work on different branches in git in my local repository which has different branches from origin set as upstream.
Do I have to create different folders for the branches in local or my computer to keep track of them or can I view codes of different branches using just one local r... | i want to work on different branches in git in my local repository which have different branches from origin set as upstream |
You are running the process inside container, if the pod dies then your process also will die. So no, it won't start from where it failed it just dies. If you have http server in front of it then you gonna get 5** status code. | I have one pod (A) running which has three replicas(A1,A2,A3). Suppose, one of my request is getting processed by pod A1. Before the completion of the process, pod A1 got down somehow. What will happen to the incomplete process? Will it start from where it failed or start again from the beginning or the process will ge... | Kubernetes Pod issue |
I tried your docker run command verbatim and it works just fine.
docker ps -l will list the latest container created, regardless if it is running or stopped, check the status column if the container is actually running, I'm guessing it's not.
If it is actually up and running you probably messed up reading the correct ... |
I am using Ubuntu 15.04 and am trying to Run a Docker image of RabbitMQ (from docker hub). I am following the steps mentioned in link:
Running RabbitMQ Docker container with Management plugin enabled
here is the command that I actually run(in case above link does not work):
$ sudo docker run -d -e RABBITMQ_NODENAME=my... | accessing the docker container for rabbitmq from ubuntu host |
There is a special lambda layer that brings ingitto lambda functions.
Checkthisandthisreference. Basically,Click on Layers and choose "Add a layer", and "Provide a layer version ARN"
and enter the following ARN (replace us-east-1 with the region of your Lambda):arn:aws:lambda:us-east-1:553035198032:layer:git:6 | I've been trying to use thegitpythonpackage in aws lambda. I've used python2.7 environment. I bundled up gitpython usingthisalong with my python code into a zip file and uploaded.import json
import git
def lambda_function(event, context):
repo="https://github.com/abc/xyz.git"
git.Git().clone(repo)It saysCmd('g... | Can't use gitpython in AWS lambda |
Well if you have a handle on the CacheManagerhttp://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/cache/CacheManager.htmlit has a method:getCache(String name)which returns a:http://docs.spring.io/spring/docs/current/javadoc-api/org/springframework/cache/Cache.htmlwhich has a method:getNativeCache()... | One of my requirements requires to see how much data i have cachedI would like to see what data is cached in Spring.Is there any way i can see what Spring cached? key and values | Spring @cachable - view cached data |
Ok, so apparently you have to choose a GitHub Pagestheme(even though you're not using it) in order for the page to be published. This seems very strange to me, and from what I can tell it's not at all mentioned in the documentation. 🤷♂️ | I'm trying to deploy a create-react-app to GitHub Pages, but I'm getting a 404.404There isn't a GitHub Pages site here.What I've done:Created a user site repo named<username>.github.ioAdded"homepage": "https://<username>.github.io"topackage.json(as per the Create React App docs)Installed thegh-pagespackageAdded and ran... | React app deployed to GitHub Pages gives "Site not found" |
CloudWatch is like a TSDB. It stores point-in-time values. You can't mutate a metric value once it is ingested. SeePublishing Metrics. Also, I don't think storing a counter in CloudWatch will be very useful. There is norate(...)function in CloudWatch like in Prometheus. The best you can do is store the deltas and use t... | I need to be able to atomically increment (or decrement) a metric value in cloudwatch (and also be able to reset it to zero). Prometheus provides a Counter type that allows one to do this; is there an equivalent in cloudwatch? All I'm able to find is a way to add a new sample value to a metric, but not increment or d... | Is there a cloudwatch equivalent for prometheus Counter? |
You probably want a CAM orContent Addressable Memory, but it really depends on the problem you're trying to solve. CAMs tend to be expensive in terms of logic, and fan-out of the read path. When used they tend to be small.To be honest it sounds like you're thinking in software terms for a hardware problem. A hash table... | I am looking for some examples of hash table implementation (insertions + lookups) in Verilog (VHDL will work too). My case is not very complicated because I know all of the values on initialization time, thus I can pretty much tell how much memory I will need, know its boundaries etc. The hash function part is not har... | Looking for a simple hash table implementation example to use as a reference |
First, these days with CI3 your HTACCESS should be :RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]And you might have some errors in your config.php be sure to set properly the base_url with a trailing slash :$config['base_url'] = 'http://ci.... | if i write url like this:https://subdomain.domain.net/directory/it works however, if I try to directly write in a browser: subdomain.domain.net/directory/ the browser trims the first slash and therefore could not load the page and the url looks like this: subdomain.domain.netdirecotryI am using codeigniter, and have th... | Writing url without https remove slash |
It turns out that since Linux 4.0, the peak RSS can be reset:
/proc/[pid]/clear_refs (since Linux 2.6.22)
This is a write-only file, writable only by owner of the
process.
The following values may be written to the file:
[snip]
5 (since Linux 4.0)
Reset the peak resident set size ("high... |
I'm trying to get the max amount of memory used during brief intervals, for a long-running linux process. For example, something like:
resetmaxrss(); // hypothetical new command
void* foo = malloc(4096);
free(foo);
getrusage(...); // 'ru_maxrss' reports 4096 plus whatever else is alive
resetmaxrss();
void* bar = mall... | Get memory high water mark for a time interval |
Redirect http://domain.com/mycompanyname http://manager.domain.com/page.php?company=mycompanyname | How do you do this...When the user entershttp://domain.com/mycompanynamebrowser redirects tohttp://manager.domain.com/page.php?company=mycompanynameNote: mycompanyname value is dynamic | redirect htaccess or php? |
Since this certificate is from acme staging its root ca not present in browsers. You need to add it to your systems trust store. | I am trying to configure https with traefik(v2.1.6) in kubernetes cluster(v1.15.2) by following thisdocumentation.My traefik deploymentYAMLlooks like this:And this is myIngressRouteconfig:apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: traefik-dashboard-route
namespace: k... | why treafik https config not work in kubernetes cluster |
+100When you contact logs endpoint what happens is that apiserver is forwarding your request to the kubelet which is hosting your pod. Kubelet server then start streaming content of the log fileto the apiserverand later to your client. Since it is streaming logs from the file andnot from the stdout directlyit may happe... | I am using client-go to continuouslly pull log streams from kubernetes pods. Most of the time everything works as expected, until the job runs couple of hours.The code is like below:podLogOpts := corev1.PodLogOptions{ Follow: true, }
kubeJob, err := l.k8sclient.GetKubeJob(l.job.GetNamespace(), l.job.GetJobId())
...
po... | What Condition Causes the Pod Log Reader Return EOF |
It's an ignition file problem.When we create a ignition file, we have to finish the installation with in 24 hours.Because the ignition files contains certificate and it will expires in 24 hours. | I tried to create a cluster in Openshift 4.2 (RHCOS) environment. I have own local DNS server and HA proxy server. I created 3 master and 2 worker nodes in VMware Environment as per the documentation. At the end of the new cluster creation I'm getting an error :Unable to connect to the server: x509: certificate has exp... | Openshift 4.2 - Unable to connect to the server: x509: certificate has expired or is not yet valid |
Problem solved:
The crux of the matter is that there was an additional (hidden) .git file in the subdirectory \somedir !
This then caused the following:
If I am in a subdirectory trying to push using:
/C/homedir/somedir (master)
$ git push origin master
it says
fatal: 'origin' does not appear to be a git >repositor... |
I am very new to Git/github.
I set up a git repo (actually migrated from another version control system), and used:
/C/homedir
$ git init
I got now that /c/homedir is my master.
I pushed to my remote github server.
This pushed only the tracked files to the remote repo.
I added a new file to the local master repo in... | Adding a file to local git repository, then pushing to remote: doesn't work |
To debug your environment add this to/etc/crontab* * * * * root env > ~/cronenvWait for file~/cronenvto be created (after a minute) and start a new shell using does environments:env - `cat ~/cronenv` /bin/shThen call your script/usr/local/bin/python3.6 /root/myscript.pyThis will help to test/debug your code within the ... | This question already has answers here:CronJob not running(19 answers)Closed3 years ago.I'm new to freeBSD.
I just set up a server and installed python 3.6.
Now i want to have a python script run every day at 15h00, so i tried to set up a cron task.
But in some way, the cron task never runs or is giving me errors.
Sin... | Running a python script as a cron job in FreeBSD [duplicate] |
You can access thePOSTbody via theFCGI_stdinstream. For example, you can read from it one byte at a time usingFCGI_getchar, which is a short form forFCGI_fgetc(FCGI_stdin). You can read larger chunks of data in a single call usingFCGI_fread. All of this I found looking atthe source. These sources often reference someth... | I am using a library fromhttp://fastcgi.com/in C++ application as a backend and nginx web-server as a front-end.Posting files from HTML-form successfully and can see the temporary files on nginx server side. But I can't figure out how to access a body of multipart POST request using fastcgi_stdio. This is my HTML-form.... | how to access a body of POST request using fastcgi C/C++ application |
You have more options to place the ACM other than on the ELB:https://docs.aws.amazon.com/acm/latest/userguide/acm-services.htmlBut if you are still wanting to use the ELB, you can just pick one subnet, or pick n subnets and leave n-1 unatended, there is no problem the requests are going to be routed to the one with an ... | I have one EC2 instance and I would like to set up HTTPS based on ACM.So it seems I must place an ELB between my EC2 instance and the DNS records if I wish to use ACM's certificate.ELB writes I must specify subnets from at least two Availability Zones.The EC2 instance is located in one particular Availability Zone.So d... | Do I have to set up 2 EC2 instances in order to use AWS ACM? |
I strongly recommend against using Referer as a way to control access to web images. The HTTP Referer request header is unreliable at best, since some people disable it in their browsers for privacy reasons, and others are behind firewalls that strip the header from all outgoing requests.Of course, Referer will also be... | I have the following code in my AWS bucket policy:{
"Version": "2008-10-17",
"Statement": [
{
"Sid": "AllowPublicRead",
"Effect": "Allow",
"Principal": {
"AWS": "*"
},
"Action": "s3:GetObject",
"Resource": "arn:aws:s... | aws referer code - not working - can't access S3 Images |
1
The rest of the equation here is just normal TCP / IP flow. You'll need to make sure of the following:
If the host has some an implicit deny for incoming traffic on its physical interface, you will need to open up ports 2000 and 2001, just like you would for any service ... |
I have following problem:
Assume that I started two Docker containers on host machine: A and B.
docker run A -ti -p 2000:2000
docker run B -ti -p 2001:2001
I want to be able to get to each of this containers FROM INTERNET by:
http://example.com:2000
http://example.com:2001
How to reach that?
| Port forwarding Ubuntu - Docker |
I think the reason is because your time and date are not right. As I can see in the log, your time is 8 days behind the current day.Please sync your time in this server and try again.ShareFollowansweredJan 28, 2022 at 4:19Chuong NguyenChuong Nguyen1,12488 silver badges1515 bronze badges11Today is Jan 28 and his TLS cer... | When I deploy new deployments or edit any settings, It returns following ErrorError creating: Internal error occurred: failed calling webhook
"mpod.elbv2.k8s.aws": Post
"https://aws-load-balancer-webhook-service.kube-system.svc:443/mutate-v1-pod?timeout=10s":
x509: certificate has expired or is not yet valid: current t... | AWS EKS Returns Error 'certificate has expired or is not yet valid' |
3
The git revert command does precisely what you describe as desired -- it creates a new change on the top of the current branch that reverses some previout change. In your case
git revert HEAD
will create a new change (your e) on top of HEAD that reverses what was change... |
This is my requirement:
I have a -> b -> c (HEAD).
I am adding a new commit d. Now, it becomes a -> b -> c -> d(HEAD).
Now, I want to revert to c (that is, undoing all changes that were made in d) and make an additional change and form e. The tree should look like a -> b-> c -> d -> e(HEAD). NOTE: I must not lose th... | git revert / stash change without losing its history |
RewriteRule ^([^/]*)$ /page/single-page.php?slug=$1 [L]This won't work because it is forwarding all URIs to/page/directory which obvious doesn't exist.You should be using this rule:# If the request is not for a valid directory
RewriteCond %{REQUEST_FILENAME} !-d
# If the request is not for a valid file
RewriteCond %{RE... | I have created my own cms and i find the following issue. The pages links show as this:https://www.example.com/page/contact-usI want them to show as this, by removing thepagealias:https://www.example.com/contact-usMy Htaccess:Options -MultiViews
RewriteEngine On
RewriteRule ^page/([\s\S]*)$ single-page.php?slug=$1 [L]... | How to remove the page alias from url with htaccess? |
Schedule an AWS Lambda task to kick this off, or use a cron job on one of your servers. | Is there any support for running Athena queries on a schedule? We want to query some data daily, and dump a summarized CSV file, but it would be best if this happened on an automated schedule. | Can AWS Athena queries be run periodically (i.e., on a schedule)? |
2
I suppose that you are a Windows user, then, you can use Notepad to browse the database if you just need to check some records.
Share
Improve this answer
Follow
answered Aug 15, 2013 at 9:48
... |
I want to open an .bak file that was created with SQL Server. There is some method to open that database with any other program?
Thanks.
| Can I open .bak file without SQL Server? |
you can use .unload() it doesn't specifically intercepts back button but any event that unloads current page. It can be anything clicking on link, forward button or back button based on the browser.
$(window).unload( function () { $('#SWITCHING_SCREENS').hide(); });
The unload event is sent to the window element wh... |
I am posting a form at the end of a JQUERY fadeIn.
When the user hits submit - a DIV 'SWITCHING_SCREENS' - with a
message in it, is faded in via JQUERY and covers the form page.
Once that div is fully faded in - javascript then posts the form to
another page.
Javascript:
Theform = document.getElementById('custo... | JQUERY caching if Back-button after posting to form - JQUERY fadeIn still visable |
There is a solution where you can monitor it on a container level based on Zabbix.Dockbix Agent XXLis an agent forZabbixcapable to monitor all Docker containers on your host.You need to deploy it on all nodes and it will collect data of your containers and sent it to your Zabbix Server.No classic rpm/deb package instal... | I am searching for a tool similar to Prometheus + Grafana that gather and record resource usage especially memory usage by process-ID or process-name.We have two components that are running different processes and they have memory leak and I want to find which process is leaking.This is from Weave Scope and it shows al... | Gather resource usage by process in a kubernetes cluster |
4
Instead of uninstalling Git, you may consider removing the current .git directory located at the root of your project (or moving it to a backup place -just in case-).
At the root of your project, run the following commands :
git init to create a fresh .git directory, i.e... |
I am learning Ruby on Rails and am unable to resolve merge conflicts in my Git repository. I was using Github for Windows, which wasn't much help. Trying to repair the damage I've probably created even bigger problems, and cannot deploy to Heroku now. I'd like to uninstall Git completely from my computer, reinstall it... | How do I uninstall Git from my computer? |
type:crontab -lto show list of crontab, your newly added crontab should be on the list. you could set the crontab to email the output to you by >[email protected], in this way you can assure the cronjob is already run.example:* * * * * /usr/bin/php /home/username/public_html/cron.php >[email protected]make surethe cron... | I'm trying to make a crontab with crontab -e, but it saves it intmp/crontab.FTt6nI/crontabthe crons don't work so I guess that's the problem. But I don't understand why. | crontab being saved in tmp/ in debian |
If you are usingAbsoluteExpirationthen you have to create a new one for every item. if you are usingSlidingExpirationthen a sinple time span might be enough. | If by default I want to create a cache where everything expires at 5 am, would I need to create a newCacheItemPolicyfor each item that I cache, or would I could a create a default 5 am CacheItemPolicy and reuse it? | Should I create a new CacheItemPolicy for every item I add to a System.Runtime.Caching.ObjectCache? |
Unfortunately there is no way to easily remove them.
My current solution to prune all unused configs is:docker config rm $(docker config ls -q) | After some time of creating and removing stacks and services on my Docker Swarm cluster, the lists returned bydocker config lsanddocker secret lsare quite extensive. However, a lot of the listed configs and secrets are outdated leftovers from previous deployments and not referenced anymore by any running service.Is the... | Clean-up unreferenced configs and secrets in Docker Swarm |
Usechangelog: falseto disable changelog generation,more detailpipeline {
agent any
options {
skipDefaultCheckout(true)
}
stages {
stage('Build') {
steps {
checkout scm
// build related tasks
}
}
stage('Deploy'... | I have a jenkins pipeline which checkouts the project repository from github to build the project in the build stage, in the next deploy stage we checkout another repository in github to read the configurations pertaining to deployment.Since we checkout two times jenkins shows two workspaces along with two changesFor t... | how to not show 2 workspace and changes in jenkins? |
That makes sense.
I would define another virtual host (beta.example.com) with that different root folder
and upon encountering cookie - do a rewriteYou can't set different roots for a domain conditionally, but you can redirect (rewrite) to another domain conditionallyThis guy's example helped me a bit agohttp://nicknot... | I've seen some limited resources on checking for cookies with Nginx, but I couldn't really find the answer I was looking for, hopefully some of you Nginx masters can give me a hand.Essentially I have a vhost that I'd like to redirect to a different domain unless the user has a cookie, here is what I've created:server {... | Nginx redirect if cookie present |
One nice trick would be todeclare the branchgh-branchas a submodule in yourmasterbranch(also more detailed in "How to add a git repo as a submodule of itself?").That way, when you are in your master branch, you see a foldergh-branchwhich represents thegh-branchcontent.You could then:versiondoconly in thegh-branchhave a... | I want to have a /doc folder in master and easily merge/sync it to the root of a gh-pages branch. What is the easiest way to do this? | Can I merge/sync a sub-folder from one branch to the root of another in git? |
Given that the extra commit you made todeveloplocally is just a regular commit (and not something like a merge commit), there is no reason why cherry picking should not work here:# from master (local)
git cherry-pick developThe above command will actually make anewcommit on top ofmaster, functionally corresponding to t... | I pose this scenario:I have two branches in the upstream repo:developmasterMy task is to create two pull requests, one against develop, and one against master.So i create two branches in my local:git checkout -b develop-local
git checkout -b master-localNow for some reason, I made the (identical) changes in both local ... | When can I cherry-pick |
You don't need to (and shouldn't) modify these generated files. The @dynamic means that the property implementations will be provided at runtime. Dynamic Properties
|
for Xcode produced Core Data managed objects, do I need to add a dealloc method to release variables?
So when I have a core data model for my iPhone app, and I let XCode generate the managed object classes, I note there is no dealloc method. Do I need to "release" in a dealloc method myself manually to the variables... | for Xcode produced Core Data managed objects, do I need to add a dealloc method to release variables? |
The problem with your last rewrite rules is that the browser is stuck in an infinite redirection loop. An infinite redirection loop happens when you visit a URL pointing to another URL, which points back to the first one. To prevent this, you must exclude the folder to which you are redirecting. Here are some possibili... | I would like to redirect users if Opera UA is detected.The following settings work fine partially:RewriteEngine On
RewriteCond %{HTTP_USER_AGENT} OPR [NC]
RewriteRule ^$ https://example.com/sub1/ [L,R=301]When accessing the URLhttps://example.com/the user is redirected tohttps://example.com/sub1/correctly, but when acc... | .htaccess: Redirect all URLs of website to specific page if using Opera browser |
According toJMeter Documentation:The JMeter HTTP samplers are configured to accept all certificates, whether trusted or not, regardless of validity periods, etc. This is to allow the maximum flexibility in testing servers.There is no easy way of disabling this behavior without modification of JMeter source code, howeve... | As the title says, i'd like to enable the authentication of server certificates in jmeter. Is it possible to configure it?What i found so far isthis articleAccording to this, "HTTP Client 4 implementation will use a TrustAll scheme". Mainly i use this client implementation (in jmeter version 3.0 or 3.1) since this is t... | Enabling server certificate authentication in jmeter |
That's a interesting idea, though I think it might be harder than you realize torebase an entire project historyontop of a bunch of updates.Here's how you could do it, in pseudo-git :-)# First fork the app template on github
# Then clone it locally
git clone your_fork_of_app_template_url
# Setup a remote to the origin... | I need some advice with my desired setup with git and Rails.Basically for my first Rails application I used a base application template from GitHub, I then made a ton of changes and now have a full application which is fairly customised.I have now extracted all of the changes I made to the files within the base applica... | Rails and Git workflow advice |
Nginx doesn't know on which port your spring boot applicaiton is running.
Make application run on port 5000 that Nginx redirects to by default by adding "server.port=5000" to application.properties or other suggested ways in the last step:https://pragmaticintegrator.wordpress.com/2016/07/12/run-your-spring-boot-applica... | I'm trying to deploy a very simple Spring Boot application on AWS Elastic Beanstalk using AWS's Java configuration (not their Tomcat configuration), but I keep getting a 502 error with the following log:2016/06/10 02:00:14 [error] 4921#0: *1 connect() failed
(111: Connection refused) while connecting to upstream, clie... | Spring Boot Application deployed on Elastic Beanstalk Java environment returns 502 |
0
Please refer to this thread, which seems to contain a solution for you.
In short, before your npm install command, try running ulimit -u 1024 to increase user process count.
The error indicates resource (ulimit) constraints.
Share
Improve this answer
... |
running the following command on jenkins pipeline
sh 'docker run --rm --name "node${commitIdLong}" -v "$(pwd)":/app -w /app node:latest /bin/bash -c "npm install; npm run build --prod --loglevel verbose"'
got the following error
node[1]: ../src/node_platform.cc:68:std::unique_ptr<long unsigned int> node::WorkerThreads... | Docker build fails and exit with error code 139 |
3
your first server block has
server_name localhost;
your second server block has
server_name 209.105.244.90;
in other words, none of your server blocks is set to listen to your domainname
-> add your domainname to the relevant serverblock
Share
Improve this ans... |
Basically, I am trying to point my domain to a different IP.
In checking website/domain , it appears the DNS has propagated over to the new IP address. When visiting the site, I see a 'Welcome to nginx!' message. If I load the IP - 209.105.244.90 directly, it shows the website. I have waited for over 24hrs for the ch... | Nginx issues after DNS change |
You should be able to set upWordPress to display at your root domain but be installed in the subdirectory. Just change ONLY the site URL under the Settings-> General screen. Leave the subdirectory in the WordPress URL box. Then you would login athttp://yoursite.com/subdirectory/wp-admin, but folks visit your site athtt... | I was digging the net and haven't found any proper solution for this issue. Basically, I want to remove subdirectory (subdirname) name from all URLs, e.g.:http://test.com/subdirname/
http://test.com/subdirname/content/
http://test.com/subdirname/content/newpageThe website is based on Wordpress and located in/subdirname... | .htaccess remove subdirectory name from all URLs |
The best way to compare work that's currently being done against the previous release is to use the Leak Period and fill your quality gate with conditions "on New Code".However, everything that's built in around the leak period and new code is focused on not adding new problems, rather than eliminating old problems. Th... | I would like to know if it is possible to add a condition in a Quality gate to compare two releases.e.g. A condition to check if a release has decreades a 5% the number of "Critical issues" respect to the prvious one. | quality gate . How to compare two releases |
Turns my nginx config was ok. The problem was with my gunicorn server was not running properly. | I'm using nginx as a proxy server to forward requests onto my gunicorn server. When I runsudo nginx -t -c /etc/nginx/sites-enabled/mysiteI get the following error.[emerg]: unknown directive "upstream" in /etc/nginx/sites-enabled/mysite:1
configuration file /etc/nginx/sites-enabled/mysite test failedAny idea how to fix ... | nginx unknown directive "upstream" |
the server does not respond until some big amount of data is collectedYes, that's one of the strange behaviours that everyone faces with SSE - and PHP.You need to add dummy data so that the PHP flush works.I use this function to add the required data to reach the data length for the flush:function sse_out($string)
{
... | I have FastCGI application, that implements SSE (server-sent events).The local test server is lighttpd and in order to make it to work properly, I needed to set:server.stream-response-body = 1in the configuration file.But on the production there is an Apache server and it does not works properly, just like lighttpd bef... | How to configure apache to work with SSE? |
For Scikit Learn for example, you can get inspiration from this public demo https://github.com/awslabs/amazon-sagemaker-examples/blob/master/sagemaker-python-sdk/scikit_learn_randomforest/Sklearn_on_SageMaker_end2end.ipynb
Step 1: Save your artifact (eg the joblib) compressed in S3 at s3://<your path>/model.tar.gz
Ste... |
If I have a trained model in Using pickle, or Joblib.
Lets say its Logistic regression or XGBoost.
I would like to host that model in AWS Sagemaker as endpoint without running a training job.
How to achieve that.
#Lets Say myBucketName contains model.pkl
model = joblib.load('filename.pkl')
# X_test = Numpy Array
mo... | Load a Picked or Joblib Pre trained ML Model to Sagemaker and host as endpoint |
You could write the "photo" content to a temporary file and then read from it using aBase64InputStream.In the end, however, theBufferedImagewill have the entire raw image in memory. This will require that you have a heap size large enough to accommodate this. You may just have to increase the Xmx value.final BufferedIm... | i need to store on disk a base64 image but i have an error: "Out of memory" when i decode base64 image into byte[]. The size image is about 6MB
This is my code:byte[] decodedBytes = DatatypeConverter.parseBase64Binary(photo); //HERE I HAVE THE ERROR!!
log.debug("binary ok");
BufferedImage bfi = ImageIO.read(new ByteArr... | Decode base64 image and store on disk (using java) out of memory |
PROXY access should be slower in theory, because data are going through Grafana backend/proxy. In real life users won't notice any difference. The best option is to measure it for your use case.I would prefer PROXY access, because then I can see query errors in the Grafana logs. | When configuring a datasource, with some datasources like Prometheus I can choose between PROXY access (access via Grafana backend) and DIRECT (access directly from browser). From what I understand PROXY is the recommended option. But it comes with a major downside to me, because now the direct links in the Grafana int... | Does datasource access via PROXY or DIRECT have a performance impact? |
The problem here is that the CNAME operates on the DNS level, not on the HTTP level. The CNAME will cause the request to be forwarded to the IP address forwww.movez.co.s3-website-us-east-1.amazonaws.com, but the HTTP request will still say it's looking formoves.co. The HTTP request doesn't containwww.movez.co.s3-websit... | So I am currently using Cloudflare for my DNS under the domainwww.movez.cobut for some reason when someone types inhttp://movez.codirectly into their web browser it spits back this:404 Not Found
Code: NoSuchBucket
Message: The specified bucket does not exist
BucketName: movez.co
RequestId: 64038C65xxx
HostId: xxxOf... | Navigating to website yields Code: NoSuchBucket when using cloudflare |
You have to add a new widget and add the query:max(rate(application_apidbacesscount_total[$__range])) by (Api)Using[$__range]instead of a fixed range will apply the values of rage selector from Grafana | I am trying to create a query that groups the data by "Api" field and selects a value field by using prometheus and grafana.My sample query (promql) ismax (application_apidbacesscount_total) by (Api) [30m:1m]. This works for getting max value with grouping the data by "Api" field.How can i do that using grafana's panel... | How to use promql group by without using aggregate functions in Grafana |
No. It saves "layers", which are essentially overlays on the file system, with some other magic for environment variables, ports, etc. No memory state is saved whatever.
|
Very new to docker, apologies for the trivial question. I'm currently using a VM and creating live snapshots (which of course save the state of the memory, etc), such that when I revert its at that exact moment. Do Docker snapshots work in a similar way? If I snapshot it with a running application will it restore to t... | Do Docker images save the memory state? |
Yes, it is possible. You have to do the following:
Enable auto-merge for your repository, see the Github documentation here
Go to the branch protection rules of your repository. To get there:
Go to your repos settings
Go to "branches" in the section "Code and automation"
Add or edit the branch protection rules for... |
I was wondering whether it's possible to automate merging of branches after tests pass using GitHub Actions.
We have two branches, 'test' and 'main'. After every merge or push to 'test', we have a Workflow set up to run tests.
Is it possible to make GitHub automatically merge 'test' -> 'main' after the tests complete,... | Automatic merge after tests pass using Actions? |
1
Use multi-stage builds. The credentials will only be part of the first stage, but the final image will not contain any of the credentials.
Basic example using multistage builds
FROM ubuntu:latest as bootstrap
RUN apt update && apt install -y curl
WORKDIR /data
ARG HTTP_... |
I am trying to build a docker image with private repositories from AWS codecommit. But this issue is a problem for any repository management software you choose to use.
I am using SSH (or HTTPS, again this is a universal problem that I can't find a simple solution to) and my credentials cannot be stored on this docker... | How do you install a private package securely with docker? |
To add to Micah's comment I can suggest running again the server image, and then the command below that is not using the hardcoded host IP 192.168.1.191 but rather pulls it from the settings:$ docker run --rm -tid --name aerospike -p 3000:3000 -p 3001:3001 -p 3002:3002 -p 3003:3003 aerospike/aerospike-server
$ docker... | I run the following docker command. I don't understand why it is failed. Could you show me how to debug this? Thanks.$ docker run -v `pwd`:/share -ti --name aerospike-aql --rm aerospike/aerospike-tools aql --host 192.168.1.191 --no-config-file
Unable to find image 'aerospike/aerospike-tools:latest' locally
latest: Pull... | docker: why Failed to connect to seed |
RemoveHandler .suffixwhere.suffixis the filename suffix for the type of a script you want to disable should do it.Looking for something that disallows scripts in general right now.Edit: Aha! If you don't mind having to serve everything in the directory as static content — you probably don't, that's what your question s... | I would like to disable any kind of CGI execution in a directory below my document root directory. Any kind: php, perl, ruby... whatever. I would like to do it in a manner it's not depensant of the file extension. Below my document root because users have to be able to put and see HTML files.It has to be in htaccess, b... | How to disable cgi in htaccess in a non-extension dependant way? |
You can have a look at the headObject() method in the AWS JavaScript SDK, but if the file is publicly accessible, a simple HEAD request (using ajax) will also do.
You can work out the cross domain issues by specifying a CORS policy on your bucket.
|
I recently changed the naming convention for a file in my job folders. Since I need to support both the new naming convention and the old naming convention when a user tries to download the specific file, I need to check if the new naming standard URL exists and if not, download from the old naming standard URL.
Is t... | Check if File Exists on AWS S3 Using Browser JavaScript SDK? |
Most likely your hosting is using some Unix-like OS ( Debian for example ) and from your question it's clear, that you're running your code on Windows ( since you're using the WAMP package ).I suppose that the problem is hidden in case sensitivity of those Operating Systems and their file systems. In your question you'... | This question already has answers here:PHP - Failed to open stream : No such file or directory(11 answers)Closed6 years ago.I am adding my index.php in public_html and I have a folder named Includes which is also in the public_html folder. Includes folder has a subfolder named PHP which contains a file paths.php.Now I ... | :Php Path Issue in Public_Html [duplicate] |
You seem to be going to the wrong URL. You've configured gunicorn to run on port 9000, but nginx is running as the reverse proxy on the default web port, which is the whole point of it. You should just be going to mysite.com; nginx will proxy the Django app to :9000 and serve the assets directly. | I have configured gunicorn on my server to run my django-backend.
It work's fine but it looks very bad. I can see my backend but it's only in HTML. No css etc like before. So I'm going to:mysite.com:9000(I choose this port for my gunicorn-configuration)I read I had to configure my django with nginx too. So I've install... | configuration django with nginx |
I think in your case theself.input()is aLocalTarget.You can Tryself.input().pathto get the path.EDIT:IfTaskBdefines multiple outputs, for example a list, you would have to do:self.input()[0].pathOr you can iterate through it.
Having that said having multiple output is notrecommendedIfTaskAdefines multiple inputs, the w... | In the Luigi's samples I have read, when you want to use the output file of a previous required task you do something like this@requires(TaskB)
class TaskA(luigi.Task):
def run(self):
with self.input().open('r') as input:
input.read()...something else etcso you are opening the output file from a... | How to get the filename of a required previous task output in Luigi |
You may want to familiarize yourself with some basic kubernetes concepts such aspodsandservices. You can also followstep-by-step examplesto learn how to run real applications.ShareFollowansweredApr 4, 2016 at 17:27Yu-Ju HongYu-Ju Hong6,74711 gold badge1919 silver badges2525 bronze badgesAdd a comment| | I downloaded kubernetes (using the command below):export KUBERNETES_PROVIDER=aws; wget -q -O - https://get.k8s.io | bashNow I have 4 minions machine and one master machine in my aws account.I want my cluster to run 3 docker containers (just a random number), just to see how this works.currently I don't have my own dock... | Creating and running docker containers cluster with Kubernetes on AWS |
First check in.hfile that you property-sythesized with retain or not if with retain then set strong instead of retain like bellow..@property ( nonatomic, strong) IBOutlet UITextField *yourTextField;;ShareFollowansweredAug 1, 2013 at 11:43Paras JoshiParas Joshi20.5k1111 gold badges5858 silver badges7070 bronze badges4I ... | I have developed application using ARC. In one of my UIViewController there are number of sub controllers (Like Buttons, Labels, Textfields, Textview, Scrollview) which all are having its IBOutlet. Here issue is that,I am using iOS 6.0.With iOS 6.0viewDidUnloadmethod is deprecated. So at the time ofPop, this method is ... | Memory warning & crash issue |
You can't recover from OOM as you never know when and where it will hit you.Try to use lazy collections like in google's guava to manipulate on data without creating an extra copy. Use cursors and iterators to avoid full data stored in the memory. | I am using Spring, Hibernate, Java 1.6 etc.
I am having a complex logic that has multiple Arralists and Maps created within a method.
The data is loaded from database into Lists and then manipulated to get data ready for jsp pages.
If the same action is performed quickly and multiple times from that page, it hits the... | Recovering from Java OutOfMemory Exceptions |
2
use exports.handler = async function(event, context) {
instead of
exports.myHandler = function(event, context) {
Share
Improve this answer
Follow
answered Nov 30, 2021 at 14:52
prince ... |
New to AWS and found it quite straightforward so far but really getting stuck packaging a lambda function.
I'm using node-lambda to try and run the function but keep getting the following error on node-lambda run:
/usr/local/lib/node_modules/node-lambda/lib/main.js:93
handler(event, context, callback);
^... | node-lambda - TypeError: handler is not a function |
There could be an issue with the basepath property in the next.config. Js, so if you have it in there, you must remove before you deploy your app on the particular server. This is recommended because, if you have that, it may results in some issues relating to routing when running behind a reverse proxy. | I'm a beginner to deploy application. I saw a lot of article that is written about deploying next.js app on Vercel or other servers that support next.js app. But I'm here because my next.js app can deploy and run on my server that I'm currently renting, but I can run the app only local host on the server. So when I acc... | How to deploy and configure next.js app on a rental server installed apache2 |
See this note
Put JDBC driver in common/lib (as tomcat documentation says) and not in WEB-INF/lib
Don't put commons-logging into WEB-INF/lib since tomcat already bootstraps it
new class objects get placed into the PermGen and thus occupy an ever increasing amount of space. Regardless of how large you make the PermGe... |
I constantly detect OOM in PermGen for my environment:
java 6
jboss-4.2.3
Not a big web-application
I know about String.intern() problem - but I don't have enough valuable usage of it.
Increasing of MaxPermGen size didn't take a force (from 128 Mb to 256 Mb).
What other reasons could invoke OOM for PermGen?
What sce... | PermGen Out of Memory reasons |
The problem can be solved easily if using compose feature. With compose, you just create one configuration file (docker-compose.yml) like this :version: '3'
services:
db:
image: postgres
web:
build: .
command: python3 manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000... | I have two Docker containersA Web APIA Console Application that calls Web APINow, on my local web api is local host and Console application has no problem calling the API.However, I have no idea when these two things are Dockerized, how can I possibly make the Url of Dockerized API available to Dockerized Console appli... | How can one Docker container call another Docker container |
Put this code in yourDOCUMENT_ROOT/.htaccessfile:RewriteEngine On
# example.com to www.example.com
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L,NE]
# http to https for subdomains
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule ^ h... | How to write htaccess rules for redirect example.com to www.example.com and also we have number of subdomains for example subdomain.example.cpm so i need to redirect it tohttps://subdomain.example.com. but when i write htaccess rules it is going to loop. please send how to write conditions for this. | How to write htaccess for subdomain redirection to https |
9
Yeah, as aholbreich mentioned, I'd use npm install / npm start locally on my machine for development, just because it's so easy. It's probably possible with docker-compose, mounting volumes etc. too, but I think it could be a bit fiddly to set up.
For deployment you can t... |
I was wondering if anyone had any experience using create-react-app with docker. I was able to get it set up with a Dockerfile like:
from node
RUN mkdir /src
WORKDIR /src
ADD package.json /src/package.json
RUN npm install
EXPOSE 3000
CMD [ "npm", "start" ]
And then used a docker-compose file like:
app:
volumes:
... | "Create React App" with Docker |
At a guess your environment is trying to get the IP of the local machine from the hostname. AWS names hosts something likeip-172-30-1-34by default but that value isn't in /etc/hosts.A very quick fix would be to add the output fromhostnameon the command line to /etc/hosts. As root, something likeecho "127.0.0.1 hostna... | So when running a Jenkins job i'm getting the following error:Unable to get host name
java.net.UnknownHostException: ip-XX-XX-XX-XXX: ip-XX-XX-XX-XXX: Name or service not knownI've read online about editing the /etc/hosts file. Right now mine looks like127.0.0.1 localhost localhost.localdomain localhost4 localhost4.l... | Jenkins java.net.UnknownHostException Error |
Since the memmap does not take the open file descriptor, but the file name, I suppose you leak the temp_fd file descriptor. Does os.close(temp_fd) help?
Great that it works.
Since you can pass numpy.memmap a file-like object, you could create one from the file descriptor you already have, temp_fd.
fobj = os.fdopen(te... |
I am working with large matrixes, so I am using NumPy's memmap. However, I am getting an error as apparently the file descriptors used by memmap are not being closed.
import numpy
import tempfile
counter = 0
while True:
temp_fd, temporary_filename = tempfile.mkstemp(suffix='.memmap')
map = numpy.memmap(tempor... | NumPy and memmap: [Errno 24] Too many open files |
working with bitmaps in android costs you a lot of memory, which needs a hude attention because of memory leaks.
you can always use
System.gc()
to garbage collect and free up some memory.
or
bitmap.recycle();
cheack out these blog post that I used when I developed my image editing app.
Curious-create.org
Evendanan... |
I've created an android app, which chooses a picture from Gallery and displays a preview.
@Override
public void onClick(View v) {
if (v.getId()== R.id.button){
Intent intent = new Intent();
intent.setType("image/*");
intent.setAction(Intent.ACTION_PICK);
startActivityForResult(Int... | outofmemory error using bitmaps Android |
to see the cpu used by my container i use the following querysum(rate(container_cpu_usage_seconds_total{container_label_io_kubernetes_pod_namespace=~"$namespace",container_label_io_kubernetes_container_name=~"^$pod*",container_name!="POD"}[1m] / scalar(sum(kube_pod_info{namespace=~"$namespace"}) ) * 100 | i try to get the metrics from my container with grafana and prometheus .unfortunately i think i make a mistake on my query to get it . When i test my container with jmeter my metric goes until 2% of load however i've 8 pod running .Even if i watch the monitoring namespace i've 0,03 .topk(3, sum (rate(container_cpu_usag... | get container metrics cpu load |
Since PREROUTING isn't used by the loopback interface we have to add one more rule:iptables -t nat -I OUTPUT -p tcp -o lo --dport 3339 -j REDIRECT --to-ports 3306ShareFollowansweredJun 1, 2014 at 8:33b0rmanb0rman4133 bronze badgesAdd a comment| | I'm trying to make MySQL available by 2 ports: 3306 and 3339
I added rule to iptables:iptables -t nat -A PREROUTING -i bond0 -p tcp --dport 3339 -j REDIRECT
--to-port 3306and everythin is great for remote connections.
But if I'm trying to connect it locally, I'm getting an error:mysql -u username -ppassword --port=33... | MySQL on two ports using IPTables - self-access |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.