Response stringlengths 15 2k | Instruction stringlengths 37 2k | Prompt stringlengths 14 160 |
|---|---|---|
FromWikipedia,SIGPIPEis the signal sent to a process when it attempts to write to a pipe without a process connected to the other end.When you first createp1usingstdout=PIPE, there is one process connected to the pipe, which is your Python process, and you can read the output usingp1.stdout.When you createp2usingstdin=... | Here is what I can read in the python subprocess module documentation:Replacing shell pipeline
output=`dmesg | grep hda`
==>
p1 = Popen(["dmesg"], stdout=PIPE)
p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE)
p1.stdout.close() # Allow p1 to receive a SIGPIPE if p2 exits.
output = p2.c... | closing stdout of piped python subprocess |
You should probably ignore the domain by adding a condition on the server name.<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{SERVER_NAME} !^my\.domain\.com
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>Also... | My main domain is a Wordpress blog, and the .htaccess rewrite for it is as follows...<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>This works... | .htaccess rewrite conditition ignore subdomain |
When using git via ssh you cannot use https:// URLs, but specific ssh addresses instead. In your case use [email protected]:Johannes-Krabbe/private-repo.git to access your repository.
|
I am trying to setup my git to let me clone/push/pull/... from and to GitHub in the terminal without entering my Username and Password, but I am getting this error:
❯ git clone https://github.com/Johannes-Krabbe/private-repo.git
Cloning into 'private-repo'...
Username for 'https://github.com': Johannes-Krabbe
Password... | Git does not use SSH key for Github (Mac OS) |
Seems as though when you connect by SSH using the browser, the IP address that instantiates the in-browser SSH connection is a Google IP, which seems to be the reason I am unable to connect, given the firewall rules I had set in place.ShareFollowansweredJan 4, 2023 at 17:19Its AndrewIts Andrew13555 silver badges1313 br... | I am unable to access my VM instance on Google Cloud Platform and I have the issue isolated I believe to the VPC firewall rules. If I allow all ingress traffic (0.0.0.0/0) then obviously I can access the instance via SSH, however if I replace0.0.0.0/0with my exact IPv4 address, I receive the following:No ingress firewa... | GCP - Unable to access instance via SSH |
Deployments do the OPs job for you while you drink coffee. What I mean by this is that a Deployment ensures that the desired state defined in your deployment manifest is maintained automatically (best effort). So, if a pod crashes, deployment will bring it up without human intervention.However, using a POD YAML to depl... | Closed. This question isopinion-based. It is not currently accepting answers.Want to improve this question?Update the question so it can be answered with facts and citations byediting this post.Closed2 years ago.Improve this questionI'm overwhelmed with the number of options in Kubernetes.There is a typical(the most su... | Helm charts vs deployments [closed] |
Yes. If you want to construct those objects within an AMP kernel. In the example belowstuffinstances are created on within theamprestrictedparallel_for_each. The constructor needs to be marked asrestrict(amp)in order to compile correctly.class stuff
{
public:
int a;
stuff(int v) restrict(amp, cpu)
: a... | Do constructors for a struct that will be used in amp code need to have restrict(amp) included? Ex:struct Foo
{
inline Foo(void)
{
}
float a;
};Or should it be like...struct Foo
{
inline Foo(void) restrict(amp)
{
}
float a;
}; | C++ AMP Constructors |
The first three commands here were all good:git add .
git commit -m "Saving changes made thus far"
git branch -m feature/123-OLDThe last one changed the namefeature/123to the namefeature/123-OLD(assuming, of course, that you were on a branch namedfeature/123in the first place).The last command is notwrong, it's just no... | New to git here. I have a feature branch (feature/123) that was originally cut fromdevelop, worked on, and then pushed to GitHub.I just started making some local changes to this branch and then I decided I wanted to preserve my changes (not throw them away entirely) and start over fresh with the version of the branch t... | Fixing detached head on a renamed git branch |
The answer to this question is a moving target. As time progresses and PATCH either becomes more or less popular, the systems in the network may or may not support it.
Generally only the network entities that will care about HTTP verbs will be OSI Level 3 (IP) and up devices (firewalls, proxies). Some of those are... |
Suppose my server exposes an HTTP-based API that uses the PATCH method introduced by RFC 5789. Is it possible that clients (browsers or otherwise) behind corporate firewalls, proxies, caches, parental controls filters and the like will encounter any problems using this method? If so, how likely is this?
Given that PAT... | Can the HTTP method "PATCH" be safely used across proxies etc.? |
You don't verify the fake e-mail address. This is how it is suppose to work. Just go ahead and use the fake e-mail address with commits.Update -GitHub recently update theKeeping Your Email Address Privatetutorial. The "Hiding your email for commits on the website" section has everything you need to know, and will credi... | I have created a GitHub account and, I do not like sharing my email address publicly (I'm sick of Spam), so I followed GitHub'sKeeping Your Email Address Privatetutorial and everything worked fine up until the point where you have to verify the fake email you created.So how do I verify this fake email that I created on... | Cannot verify Fake email in GitHub |
Got the problem. I was using the wrong git repository altogether. Correct URL must be:git clone https://[email protected]/gerrit/mytest | My question is NOTthisquestion.On performing agit cloneI am getting this error. Command than I am using is:$ git clone "https://gdt.test.com/gitblit/log/?r=mytest.git&h=refs/heads/branch_development"On simply running:$ git clone "https://gdt.test.com/gitblit/log/?r=mytest.git"I get the error:fatal: could not create wor... | not valid: is this a git repository? |
Try this:RewriteCond %{REQUEST_URI} !\.(gif|jpg|css|js|ico|png)$ [NC]
RewriteCond %{REQUEST_URI} !^/(sitemap\.html|includes(/.*|))$ [NC]
RewriteRule ^ /sitemap.html [R=301,L]Sure both RewriteCond lines can be combined into 1 but I would suggest keeping it 2 separate as this is easier to read and easy to maintain in cas... | I'm trying to manipulate the .htaccess file on my blogs server to allow certain content to be redirected while allowing others to be accessed.What I would like to do, is allow any file with the extension of(gif|jpg|css|js|ico|png)to be accessed along with a directory/includes/and a filesitemap.htmlwhile all other traff... | Apache Redirects - .htaccess - ReWriteCond |
Here's my specific take on ARC:1) XCode has "Convert to Objective C ARC" menu. Is the conversion is that simple (nothing to worry about)?It's simple. It works. Use it. As Kevin Low points out though, you will need to go through and fix up the bits where you use Core Foundation objects. That will just require a healthy ... | When I moved to Objective C (iOS) from C++ (and little Java) I had hard time understanding memory management in iOS. But now all this seems natural and I know retain, autorelease, copy and release stuff. After reading about ARC, I am wondering is there more benefits of using ARC or it is just that you dont have to wor... | ARC, worth it or not? |
See thepython docs section on FCGI. Basically, with Python, you use the WSGI interface on top of an fcgi server which talks to the web server (the fcgi client).SeePython + FastCGIfor a couple of Python fcgi servers.Edit:This nginx wiki pageexplains exactly how to set up Python with nginx using fcgi.This wiki pagedescri... | I am looking to run standalone python scripts through fcgi for use with nginx, but I have no idea where to start with spawning the processes. Currently, I have PHP successfully with nginx+fcgi, but I'm unsure if/how I can do the same with python. Any suggestions on where to start? | Running python through fastCGI for nginx |
This isn't supported yet.One solution would have to group your Git repos in a parent Git repo, declaring them assubmodules.ButSONARSCGIT-6shows that submodules are not yet supported in theSonarQube SCM Git plugin. | I am trying to make work the SCM support with git on my sonar project but I get an error because my workspace root is not a git repository.Indeed I have several git repositories for a single project so my workspace root is not a git repo but the subfolders are.I thought that thesonar.sourcesvariable would do the trick ... | How to use Sonar SCM support with a workspace root that is not a Git repository |
One way is tousepg_dumpto generate a flat sql dump, which you can gzip or whatever. This is certainly the easiest option, as the results can be piped back in topsqlto re-load a database, and since it can also export as plain text, you can look through or edit the data prior to restore if necessary.The next method is to... | I have a script that will produce daily rotated backups for mysql, but I can't find anything similar for postgres. I have also discovered that it has an online backup capability, which should come in handy since this is a production site.Does anyone know of a program/script that will help me, or even a way to do it?Tha... | Does anyone know of a good way to back up postgres databases? |
I don't think you can get exactly what you want with the Cluster Autoscaler but I'll hopefully give you a couple options and pointers to further explore.The Cluster Autoscaler has the notion ofExpanderswhich can help determine which node group to scale up when a scaling event happens. Thepriceexpander seems to be close... | i need a solution for that:i have 2 node pools in gcloud kubernetes, first is preemptible and autoscaling, second is only autoscaling.Jobs should be started on the first one ( with preemptible VMs ), but when no resources on the first pool are available Jobs should be started on the second one.How can i realize that, m... | gcloud kubernetes node pool: high priority for preemptible VM nodes possible |
0
I'm guessing that this has to do with the way that V8 uses "hidden classes" to represent similar objects, but what you are reporting seems to be a pretty dramatic difference in footprints...
You can read more about hidden classes here: https://developers.google.com/v8/des... |
I wrote a small memory benchmark for node.js: http://pastebin.com/KfZ4Ucn4
It measures memory usage using process.memoryUsage().heapUsed for 3 cases:
Array of objects with 10 properties, different property names for each element
Array of objects with 10 properties, same property names
Array of objects with 10 propert... | Internal array representation in v8/node.js |
You have to add them to the.gitignorefile. | This question already has an answer here:.gitignore when developing Python and Django Applications on Windows(1 answer)Closed2 years ago.I am completely new to package development.When I runpython setup.py sdist bdist_wheelcommand, it is creating 3 additional folders in my package directory:builddistpackage_name.egg-in... | Should I add .egg-info, build and dist directories to .gitignore [duplicate] |
I think your .htaccess files look correct. You might need to tell Apache where the webroot of your app is.Try adding a vhost entry in your Apache configurationinside\xampp\apache\conf\extra\httpd-vhosts.conftry adding something like:<VirtualHost *:80>
ServerName localhost
DocumentRoot c:\xampp\htdocs\app\webroot ... | I'm trying to get a CakePHP application to work. I use xampp and put my application files in /xampp/htdocs. For .htaccess configuration I refer tohttp://book.cakephp.org/1.2/view/37/Apache-and-mod_rewrite-and-htaccess. After that I'm trying to run my application, but I've got this message in browser.The server encounte... | CakePHP application cannot start in localhost |
TensorFlow is not always good at sharing GPUs with other processes (including other instances of itself!). The typical workaround is to use the%CUDA_VISIBLE_DEVICES%environment variable to prevent the two processes from clashing over the same GPU. For example:C:\>set CUDA_VISIBLE_DEVICES=0
C:\>python tensorflow_program... | I'm little bit new with tensor-flow.. so please be gentle with me..
I have problem with creating second process that load tensorflow on already working GPU.the error I get is:\cuda\cuda_dnn.cc:385] could not create cudnn handle: CUDNN_STATUS_NOT_INITIALIZED
\cuda\cuda_dnn.cc:392] error retrieving driver version: Permi... | multi process multi GPU with tensorflow, windows |
It is not possible to communicate between Amazon EC2 regions via the private IP addresses (except if you setup a VPN and respective routing for this, see section VPN Solution below), traffic between regions is in fact passing the public internet and is not distinguishable from any other internet traffic, see e.g. the ... |
I have two EC2 instances from an Ubuntu image, they are located in different regions.
I just want to ask, whether they can communicate over the private IP addresses?
I have opened the required ports with a security group. I use netcat to test the communication, but it only works, when I use the public IP addresses.
| Can EC2 instances in different regions communicate over their private IP addresses? |
This should be fine.
dispatch_async(downloadQueue, ^{ // --> downloadQueue will add a retain on self when it's created
dispatch_async(callerQueue, ^{ // --> callerQueue will add a retain on self when it's created
...
}); // --> callerQueue will release it's retain when it gets d... |
I am using the following code to asynchronously download an image and set it to an image view .
dispatch_queue_t callerQueue = dispatch_get_current_queue();
dispatch_queue_t downloadQueue = dispatch_queue_create("com.myapp.processsmagequeue", NULL);
dispatch_async(downloadQueue, ^{
NSData * imageData = [NSData... | Blocks and memory leaks |
I was commiting the files withgit commit -am <message>but I forgot to dogit add *after I created a new folder which made github to never have the folder with the files init. | I am trying to deploy a react site project to netlify using github. It is the second project I have encontered this error.In my first project I was able to deploy the site normally, but then I went back and a created a folder to store all my components related to a single component (E.g. all NavBar components to sit wi... | When deploying a react site using netlify, it fails when a have an extra folder in my src folder but it works when I no longer have that folder |
0
If you only see an issue, but don't have a fix, create an issue on the GitHub repository.
However if you also know how to fix it, fork the repository and create a pull request.
Share
Improve this answer
Follow
... |
I'm working on a repo and the git hook files(inside the '.git/hook' directory) have and issue. How can I propose changes to these hooks to the repo owners?
The project in hosted on github.
| Include changes to git hook files in a commit |
It looks like you are not setting the working directory, so you may need to give an absolute path for the output file | #!/bin/bash
#!/bin/sh
# Need help
__help() { echo "$0 [ stop|start ]" 1>&2; exit 1; }
# Not enough args to run properly
[ $# -ne 1 ] && __help
# See what we're called with
case "$1" in
start) # Start sniffer as root, under a different argv[0] and make it drop rights
s=$(/usr/local/sbin/tcpdump -n -nn -f -q -i ... | shell scripting help cron job not executing |
You can extract committer e-mail, author name, etc. to environment variables usinggit logwith--pretty, e.g.export COMMITTER_EMAIL="$(git log -1 $TRAVIS_COMMIT --pretty="%cE")"
export AUTHOR_NAME="$(git log -1 $TRAVIS_COMMIT --pretty="%aN")"On Travis one'd put this in thebefore_installorbefore_scriptstage.TRAVIS_COMMITe... | I know committer_email, author_name, and load of other variables are part of the notification event. Is it possible to get access to them in earlier events like before_script, after_script?I would like to get access of the information and add it directly to my test results. Having build information, test result informa... | Travis-CI, how to get committer_email, author_name, within after_script command |
Check first, asin here, if you have a a link to an invalid png in another markdown cell.In other words, the png might not be the issue (no need to delete it).But an invalid reference to a png with the same name might trigger the error. | I'm trying to upload a Google Colab notebook to GitHub, but I keep getting the error:Invalid notebook
missing attachment.I went back and deleted the line for that png but still after resaving the notebook and trying to upload it again it says the same thing just for another png.Is there a way to fix this without delet... | Github invalid file error in uploading google colab file |
The easiest way is to try the following process in a new directory, to see if the issue persists:
clone your GitHub repo (that way, we are sure the git remote -v will show a proper remote for your new local repo)
git checkout the right branch: switch to the branch you want to work on
make new commits on it
git push -... |
I have a project locally that I pushed to github. Each time I am trying to push a commit to github it asks me for the remote url. Can't I configure it so that it will automatically push to my desired branch.
I tried setting up remote tracking in repository view but it starts cloning the repo which I don't need since ... | how do I configure my git remote branch in eclipse for a repo on github? |
I'm a new user, I can't write a comment.Try looking at the log file. Sometimes you can read the cause of premature death there.$command = "ffmpeg -i ".($temp_dir."/".$folder."/".$sub_file)." -vf scale=1280:-1 -c:v libx264 -preset veryslow -crf 24 ".$temp_dir."/".$folder."/edit-".$sub_file." > ".$temp_dir."/".$folder."... | I have a cron setup to take locally uploaded videos, create a screengrab, compress the video and upload to online storage. I am using ffmpeg with php and have tried a few different ways but though it does compress the file size I keep getting a saved file of just the first second of the video. I tried delaying the pr... | Ffmpeg compression cron cutting video to 1 second |
First, you need to go to that folder where package.json resides and open cmd by pressing SHIFT+ right click on that folder(please check path, it should be correct), then donpm install, after that donpm start.If it's worked fine then good and if you already installed the dependency then do the following things:Delete No... | I just cloned a react app to my local computer from GitHub, and I set npm install but when I go to run an npm start on it, I get this error:C:\Users\NOUREDDINE\Desktop\Redux>npm start
npm ERR! path C:\Users\NOUREDDINE\Desktop\Redux\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! en... | I just cloned a react app to my local computer from github, but when I go to run an npm start on it, I get this error: |
Turns out, you can SSH into your EC2 instance and install ImageMagick manually, the caveat is that manual changes will not persist if there are updates to the instance itself. The best way to do this is to create an .ebextensions folder and add a config file. Something that looks like this:
packages:
yum:
Imag... |
I'm running rails 4.1 and paperclip 4.2, after I deploy to AWS Elastic Beanstalk I cannot save files with paperclip to S3, I am getting an error:
Command :: file -b --mime '/tmp/308f17f99f5a4157c8839634d039b1c620141002-22818-7crhx4.jpg'
Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/308f17f99f5a4157c883... | Paperclip cannot find ImageMagick on AWS Elastic Beanstalk |
You have a two options:Fork the repo (won't be private though)Clone the repo:git clone <repo url>
cd <repo directory>
git add . && git commit -m "<commit message>"
git push origin <branch>Cloning it is the only way to have the same repo but private.ShareFollowansweredNov 18, 2020 at 20:00user13372194user... | I have read thehelp pageand I have managed to transfer it to my organization but it is thenmyorg/reporather thanmyuser/repo. I can create a new repo as my org which ismyuser/repothough so there must be some way to transfer it like that, but I can't find it. | GitHub: How can I transfer a repo that I own to an organization I own and keep it on my private account? |
When you wrote:Ive got a website in a subdirectoryI am assuming that you moved all images, css etc to subdirectory as well.If that is so you can manage it using a simple RewriteRule. Create a .htaccess under DOCUMENT_ROOT with this code:Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteB... | Ive got a website in a subdirectory but all the image, link and CSS paths are set like this:"/images/error.png"
or "/help.html"
or "/css/styles/stylesheet.css"I've tried a million different .htaccess things and tried setting the base href tag to the domain.com/subfolder.I can't seem to get anything to work!Also: There ... | Moves website to subdirectory - Getting images/css paths to work? |
There were several bugs in Hudson's subversion plugin involving dealing with SSL certs and their passwords. Here's the one I reported, which they have fixed:http://issues.hudson-ci.org/browse/HUDSON-5230. So now, it should properly save the cert you upload.Upgrade to the latest version of Hudson (Hudson ver. 1.342 or l... | I'm trying to use Hudson (which uses SVNKit) to access a Subversion repository that requires a client certificate to access it. I can access the same repository using the same client certificate via Eclipse (also using SVNKit).When Hudson tries to check out the repository, it fails with:org.tmatesoft.svn.core.SVNExcept... | Why am I getting handshake_failure with Java SSL cert? |
Use fresh FastMM, enable Map file construction in Linker options, define conditional symbol FullDebugMode and rebuild the program. Then go through your steps. On program termination, it should generate file programname__MemoryManager__EventLog.txt with information on where in the program the leaked object was construc... |
I'm getting the memory leak message upon shutdown, saying that I'm leaking 3 of a certain object. Two problems with that, though.
It only happens intermittently. I can run my program, go through the exact same series of steps, (open a data file, display it, and shut down again,) and sometimes the message will show ... | Why does Delphi's memory manager report false memory leaks at shutdown? |
Your best bet is passing (optional) environment variables to your docker container that can be processed by your startup script.docker-compose.yml:version: '2.1'
services:
www:
image: somenginx
environment:
- ${UID}
- ${GID}Then use the values of$UID/$GIDin your entrypoint script for updating the ... | I have the following script as the ENTRYPOINT of my Dockerfile and therefore Docker image:#!/bin/bash
set -e
# Setup permissions
data_dir="/var/www/html"
usermod -u 1000 www-data && groupmod -g 1000 www-data
chown -R www-data:root "$data_dir"
if [ -d "$data_dir" ]; then
chgrp -R www-data "$data_dir"
chmod -... | Dynamically pick the user GUI and UID who's running Docker at the host from entrypoint |
You can do it at the input level in HTML by adding autocomplete="off" to the input.
http://css-tricks.com/snippets/html/autocomplete-off/
You could also do it via JS such as:
someForm.setAttribute( "autocomplete", "off" );
someFormElm.setAttribute( "autocomplete", "off" );
|
Is there a way to disable autofill in Chrome and other browsers on form fields through HTML or JavaScript? I don't want the browser automatically filling in answers on the forms from previous users of the browser.
I know I can clear the cache, but I can't rely on repeatedly clearing the cache.
| Disable autofill on a web form through HTML or JavaScript? |
11
I found the repositories I've pushed code at https://github.com/settings/repositories
Share
Improve this answer
Follow
answered Nov 14, 2021 at 22:14
Pablo Manuel GonzálezPablo Manuel Go... |
One of our team member create a repository and all other team member can push their own work to this repository. It seems that, under the tab "Contributions" there should be two kinds of directory: "Popular repositories" and "Repositories contributed to". I push my work to this repository from the user Interface of Ec... | How to show the "Repositories contributed to" on github |
According to thedocs:Useskaffold devto build anddeployyour appevery time your code changes,Useskaffold runto build anddeployyour app once,similar to a CI/CD pipeline1. Deploy your services:skaffold run --filename=skaffold_test_1.yaml(in addition you can have multiple workflow configurations).2.Change your skaffold work... | I use skaffold for k8s based microservices app. I enterskaffold devandskaffold runto run andskaffold deleteto restart all microservices.If I need to restart only one service, what must I do? | How can I restart only one service by using skaffold? |
I use Firefox with Stylish:@-moz-document domain(github.com) {
#fullscreen-contents {
font-family: Consolas;
}
}Source | Is there a way to tell Github Zen mode (full screen text editor) to use a fixed-width font? | Github Zen mode editing with fixed-width font? |
Are you sure, you want to do that? Even css and js files and images and ...?OK, first check if mod_access in installed to apache, then add the following to your .htaccess:Order Deny,Allow
Deny from all
Allow from 127.0.0.1
<Files /index.php>
Order Allow,Deny
Allow from all
</Files>The first directive forbids a... | I want to deny direct access to all.phpfiles except one:index.phpThe only access to the other.phpfiles should be through phpinclude.If possible I want all files in the same folder.UPDATE:A general rule would be nice, so I don't need to go through all files. The risk is that I forget a file or line.UPDATE 2:Theindex.php... | Deny direct access to all .php files except index.php |
you can define in yourscrape_configsfromprometheus.ymlfile different alabelwith the same name and different values for each node exporterscrape_configs:
- job_name: 'nodeexporter-01'
scrape_interval: 5s
static_configs:
- targets: [ 'nodeexporter:9100' ]
labels:
instance: 'nodeexporter-... | I have a distributed system consisting of 100s of devices which has node exporter installed on them. My main server has a prometheus server which scrapes all these data. How do I know which data is coming from which of the devices? | I have installed Node exporter on 100 different servers and reading data collected on my prometheus server. but unable to distinguish data |
I solved my issue by mapping the Spring Boot port to port 80 in the production profile.This allows me to map the DNS records to raw IP address without having to do any extra configuration. | I have a docker image running on Google Compute Engine. The image contains a Spring Boot application running on port 9000.It is exposes onhttp://<ip>:9000and I can access is without any problems. I am trying to configure the exposed port to be80in order to configure DNS record to point just to the IP address.My questio... | Mapping ports in Compute Engine with Docker |
I wouldBe explicit wrt. your directory to execute from e.g./root/scripts/test.sh. I don't know what cron would regard as thecurrentdirectoryRedirect stdout to a log file e.g....test.sh > /tmp/cron.log(you would likely want to redirect stderr at some stage too using2>&1).Otherwise you're not going to see the output. It ... | I have a Shell script like belowecho "Hello World"The script is located in/root/scripts/folder astest.shI also created a cron job like below0-59 * * * * ./scripts/test.shNow the cron job is not printing the content intest.shevery minute.Let me know whether I have given a wrong directory or I have any other problem in ... | How to run a Shell Script by Cron Job |
Posting this as an answer for better visibility since it's a good solution:David suggestedthat you canprobably put both parts into the same Helm chart, probably with differenttemplates/*.yamlfiles for the front-and back-end parts.If you had a good argument that the two parts are separate (maybe different development te... | I have a monorepo nodejs/react app that I want to deploy to GKE using Helm charts. I added two Dockerfiles one for the frontend and the other for the back.I'm using Helm Charts to deploy my microservices to the Kubernetes cluster but this time I don't know how to configure it so that I can deploy both back and front si... | Deploy both front and backend using helm charts |
Something bad is happening if viewDidLoad is getting called every time your view is shown. viewDidAppear should get called, but viewDidLoad should only be called the first time the view is needed and if the view is needed and viewDidUnload got called.
|
I need to load some data in my UIViewController to show a UIPickerView widget in an iPhone modal view.
I did some research and found this answer in SO. I proceeded to implement my data reading code in initWithNibName:bundle: and data unloading in dealloc. However, Instruments kept telling me there was a memory leak wh... | Loading and unloading data in UIViewController |
express-fingerprintprovides a fingerprinting system based on characteristics observable in the contents of Web requests, without the use of any code executing on the client side.https://www.npmjs.com/package/express-fingerprint | I have a node/express App and i would like to get the unique device fingerprint from where the app gets invoked. I came across some of the famous fingerprinting open source packages likehttps://github.com/Valve/fingerprintjs2but unfortunately this library supports browser fingerprinting and not generate unique fingerpr... | NodeJS - Get unique devicefingerprint |
3
Here is the way to work with path based routing
Create Target group ( valid VPC, PORT, Proper health check )
Add instance to the target group
Go to LB and click on the existing listener
Create new Rule and Add the new target group
Verify Health check
As I see a sim... |
I want to create an ALB which should route my traffic based on path to different websites. For example.
example.com/apple/ should go to 8080
example.com/grapes/ should go to 8180
example.com/oranges/ should go to 8280
Could you please guide me, how can i achieve this.
What i have tried so far is below.
Create listene... | Path based routing in AWS ALB to single host with multiple ports |
I forgot to allow access to the organization on GitHub.Settings -> Applications -> Authorized OAuth Apps -> Jetbrains -> Organization Access | I cannot push or pull using PhpStorm. I have a GitHub account connected to PhpStorm and the project I'm working on, but every time I try to pull or push, a 'login to GitHub' window pops up. When I then authorize (again), it just says:remote: Repository not found. repository 'https://github.com/xxx/yyy.git/' not foundTh... | Cannot pull or push using PhpStorm, but it works on the command line |
IE (well, technically, JScript) has an undocumented CollectGarbage method, which supposedly forces garbage collector to run immediately. You might want to play with that, but from my experience, nulling references is enough most of the time.
|
I have an AJAX-based website using JavaScript on the client. Certain operations on the site cache large result sets from service calls in the browser (i.e. hundreds of megabytes). These are throw-away results. They will be viewed for a short time and then need to be cleared from memory.
I've written a small test ... | Using JavaScript with Internet Explorer, how do I clear memory without refreshing the page? |
1
So when you consider containers you cannot view it as a single application or service per host.
Traditionally people would have an individual or multiple instances all running a single application. With containers, you would have an application per containers. So an ind... |
I understand the basics how containers and how they differ from running virtual machines. I also get that auto scaling when resources are low and how services such as AWS can horizontally scale and provision more resources for you.
What I don't understand however is how containerisation management technologies such as... | I don't fully understand how containerisation doesn't lead to over provisioning instances from the start |
AKS only supports ubuntu at this time, so this is not yet possibleShareFollowansweredMay 31, 2019 at 7:564c74356b414c74356b4170.5k66 gold badges104104 silver badges145145 bronze badges0Add a comment| | When using a Kuberenetes service on Azure the nodes are by default built with an Ubuntu image.I have a use case of wanting to add more nodes but on the az CLI the os-type is only Linux (ubuntu) or Windows.Is there a way of adding a Node to an existing Kubernetes cluster on Azure that is of different Linux types like Ce... | Azure AKS add node with different Linux OS |
1
It seems that's a driver bug in the php-mysql driver, it allocates massive amounts of memory based on the MAX_BUFFER attribute and does not release it anymore when using PDO.
I switched to the native driver mysqlnd and the issue vanished.
Share
... |
I've had a server reboot and something changed.
Suddenly tiny SQL queries using PDO to MYSQL require roughly 90MB of memory.
It uses 3 times the highest input buffer.
MEM: 3586264 / 4718592
MEM: 96740584 / 98304000
MEM: 96740584 / 98304000
The code is as simple as possible:
$a=memory_get_peak_usage(fa... | PHP->PDO() a query with about 500 byte content needs 100 MB of PHP memory suddenly |
1
Try select_related in your FKs:
This can limit the number of round-trips to the database which can be the biggest performance problem for Django.
Share
Improve this answer
Follow
edited Nov 6, 2019 at 19:1... |
I have a site running django with nginx. It is running good, but there are some sections where I get 502 Bad Gateway.
After a bit of analysis, I figure out the pages to be the ones with large contents in them while loading.
For Example: I have "college" app and "course" app. A college can have many courses, now if I t... | 502 Bad Gateway for Large Requests (nginx + django) |
You can use nginx_rtmp module ... It's support stream flv files as rtmp streams (and transcoding rtmp streams, and repackage rtmp to hls too)
See doc about: https://github.com/arut/nginx-rtmp-module/
j
|
I am triyng to figure out how to load balance my video server.
The real world scenario is;
i have a storage server which stores all my video files, an several
servers to load balance my http request(works like a CDN service).
Client requests a video file -> Nearest Load balancing server
answers request (lets s... | How to stream on demand video with load balancing |
If you're using rancher to bring k8s cluster on AWS using amazon EC2 option.Then it will provision new EC2 in your aws account and will configure everything on it (like installing docker, k8s and so on).To avoid this and to use your own ami which has pre-pulled docker image, you need to usecustom k8soption of rancher.I... | When creating a cluster with Rancher I note that Docker appears to be installing on the nodes(through rancher server ui). The problem is I am using an AMI with docker already installed with a docker image that I would like to use on the cluster after provisioning. This re-installation of docker appears to remove this d... | Rancher provisioning nodes overwrites docker images |
You might want to look into running your script as a daemon. PEAR's System_Daemon class manages a lot of this functionality. You can take a look athttp://kevin.vanzonneveld.net/techblog/article/create_daemons_in_php/for a good tutorial on how to set up a daemon.Cron is obviously better for a timed task, but if cron re... | Hey!
i'm looking for some way that can help me in task like this:
write a function that every 2 days clear content of XML file. Do this with no CRON or similar tools, just PHP.
So far i've never done time-related-run script so is there a way to make it with only PHP?
I assume that everything what functions does is with... | Php script running few times a day with no CRON? |
2
Based on that NGINX block, you will need to request that URL including the trailing slash.
The NGINX block will match URLs as follows:
/api/Image/foo/bar
/api/Image/
But not
/api/Image
Which is how your cURL command is constructed:
curl http://local.docker:8080/api/Imag... |
I am trying to use proxy pass to access an image service, however, my nginx container is running on port 8080 and when nginx passes to the service it redirects the user to port 80.
Here is my nginx snippet:
location /api/Image/ {
proxy_pass http://image.service.com/api/Image?$args;
proxy_redirect off;
proxy_... | How to keep url port with proxy_pass in nginx |
Referring to Grafnachartyou need:# `existingSecret` is a reference to an existing secret containing the smtp configuration | I am providing smtp configuration through values.yaml but the grafana not able to take this settingsProvided smtp configuration through values.yaml like{
"grafana.ini":{
"smtp": {
"enabled": true,
"host" : "smtp.mailtrap.io:25",
"user" : "username",
"password" : "password"
}... | How to add smtp settings using helm chart to prometheus-operator? |
In the.htaccessfile, add the line:SetEnvIf X-Forwarded-Proto https HTTPS=on | Im using this .htaccess to add date,hour,minutes at end of my url example:example.com/pagename?201502201855It works in all my posts and pages but if i navigate to page number 2,3,4,5,6 exampleexample.com/page/2/?201502211929then i get error: This webpage has a redirect loop Error code: ERR_TOO_MANY_REDIRECTS# BEGIN Wor... | .htaccess - ERR_TOO_MANY_REDIRECTS |
The sessionretains the tasksinside it until after the task completes (including calling any completion handlers). There's no need to retain it yourself. | When I use thedataTaskWithRequest:completionHandler:API onNSURLSession, do I have to keep a strong reference to the task I get back so it doesn't get deallocated before completing, or will the system hold onto it until it completes?For example, is this OK:[[[NSURLSession sharedSession] dataTaskWithRequest:myRequest com... | Do I have to maintain a strong reference to an NSURLSessionDataTask with completion handler? |
0
here is the solution for
docker swarm service:
services:
logstash:
image: docker.elastic.co/logstash/logstash:6.4.2
ports:
- 25000:25000
- 25000:25000/udp
logging:
options:
max-size: "10m"
max-file: "10"
Share
Imp... |
I'm running a logstash container in AWS ECS from the following image
docker.elastic.co/logstash/logstash:5.5.3
Everything is at default and I am not using the stdout plugin. But logstash still outputs all the log items to stdout and the container is generating a huge log file at
/var/lib/docker/containers/51889a642e... | dockerized logstash is generating huge log files |
Detecting the memory consumption in Java to react on your code on it is not a good idea. You never know how the garbage collector behaves, when it is started and how often, how much memory it can free up, …
You could use a WeakReference (java.lang.ref) if you want to prevent that a reference to an object prevents that... |
In order to prevent an OutOfMemoryError I would like to create a code that cleans some caches in my program when there is a danger of outgrowing the available RAM.
How I can detect from inside the code when memory is at a certain percentage from the maximum available, and be able to react?
| Detect low memory in Java? |
It should be this way: myrepo.git#:myfolderversion: "2"
services:
php:
build:
context: https://github.com/wodby/drupal-php.git#:7
args:
- BASE_IMAGE_TAG=7.1
- WODBY_USER_ID=117
- WODBY_GROUP_ID=111
volumes:
- ./:/var/www/htmlhttps://docs.docker.com/engine/ref... | I would like to build a new image in my docker compose project using a git repository as I need to change some ARG vars.My concern is that the Dockerfile is inside a folder of the git repository.How can be specified a folder as build context using a git repository?Repository:https://github.com/wodby/drupal-php/blob/mas... | Docker Compose build context from git repository with Dockerfile inside folder |
I was also facing the same issue, so I changed the API version for thecattle-admin-bindingfrom beta to stable as below:Old value:apiVersion: rbac.authorization.k8s.io/v1beta1Changed to:apiVersion: rbac.authorization.k8s.io/v1Though I ran into some other issues later, the above error was gone. | while I try to add my k8s cluster in azure vm, is shows error like
error: resource mapping not found for name: "cattle-admin-binding" namespace: "cattle-system" from "STDIN": no matches for kind "ClusterRoleBinding" in version "rbac.authorization.k8s.io/v1beta1"
ensure CRDs are installed firstHere is the output for my ... | resource mapping not found for name: "cattle-admin-binding" namespace: "cattle-system" |
The major risk is if the folder can be downloaded. If it is, anyone can download all the source code.You can trygit clone http://website.com/.git. If it's work you have to secure that.You can have complete informationhereandthere | Recently started using Git via Bitbucket which is great. However I was a little concerned to be able to view the file tree from any browser?I do have .gitignore enabled but I assume no file data or commit refs cannot be linked or of use to third parties. The folder permission for.git/is755by default on my hosting.Here ... | Is a viewable .git folder a security risk? |
Try these:
http://www.mycplus.com/tutorials/cplusplus-programming-tutorials/memory-management/
http://www.cantrip.org/wave12.html
http://linuxdevcenter.com/pub/a/linux/2003/05/08/cpp_mm-1.html
And in wikibook: http://en.wikibooks.org/wiki/C++_Programming/Memory_Management
This article will compare the Java memory mana... |
I'm moving from Java to C++ and have really enjoyed it. One thing I don't enjoy is not understanding memory at all because Java used to do that for me.
I've purchased a book : Memory as a Programming Concept in C and C++ - Frantisek Franek
Are there some good sites for me to go and learn interactively about C/C++ an... | C++, Seg Faults, and Memory Management |
git fetch upstream # pull in latest changes from upstream, including b2
git push origin upstream/b2:b1 # push tracking branch upstream/b2 to origin/b1 | I have a git system with upstream/origin/local .upstream has branch b1 and b2
origin has branch b1
local has b1.I want to put changes of b2 (which is b1 + some new commits) to origin b1.I tried the command :git fetch upstream b2
git checkout origin/b1
git merge upstream b2 (which shows a Fast-forward)
git push origin b... | Git merge upstream branch |
Usenode-schedulemodule and write this in your server:schedule = require('node-schedule');
schedule.scheduleJob('0 0 4 * * *',
function (fireDate) {
console.log(`fireDate: ${fireDate}`);
console.log(`now: ${new Date()}`);
yourRemoveFunction()
.then(result => {
console.log(`data removed at ${... | end is using express and postgres as its DB. Currently my schema is.createTable('users', users => {
users.increments();
users.string('email').unique().notNullable();
users.integer('total_points').defaultTo(0);
// Everything below this needs to reset back to 0 every 24 ho... | Delete User Data every 24 hours, node.js postgres |
You should be serving static files directly from nginx instead of doing it through .NETAssuming you have/css,/jsfor your assets located in your/www/inetpub/assetsfolder then you would add below to your nginx configlocation ~* ^/(css|js)/ {
root /www/inetpub/assets;
}This will servercssfrom/www/inetpub/assets/cssfold... | I'm busy building a website using asp.net core 2.0, and it's hosted on a Ubuntu 16.04 server with Nginx acting as a proxy. It's not a live environment but a local.What I would like to know is, when updating static view's, eg. the about page with extra content, and upload it to the dev server, it does not update until I... | Refreshing static html cache on asp.net core 2.0 |
You can use:RewriteCond %{REMOTE_ADDR} ^(38\.100\.121\.65|206\.141\.173\.244|68\.14\.150\.24)$You have a problem with:^68\.14\.15\0.24$and^168\.114\.125\0.24$I think you want to use:^68\.14\.150\.24$and^168\.114\.125\.24$ | I am trying to trim my htacess file. Other than the # lines is there any way I could make it smaller? It seems to be working as I was hoping as is. Cut I was hoping there might be a way to have more one ip per line, instead of doing one line for every ip address.<Files 403.shtml>
order allow,deny
allow from all
</File... | Trimming my htaccess file |
You just have to push content to the remote git repository.You have to differentiate between aUser-Page(username.github.io) and aProject-Page(username.github.io/projectname)User-Page:git clone https://github.com/username/username.github.io
cd username.github.io
echo "Hello World" > index.html
git add --all
git commit... | Is there any way to enable Github pages through the api?
Not requesting a page build, I mean the initial enabling of the feature and pointing to a branch. | Programmatically enable Github Pages for a repository |
I found a way.We can specify the directory we want to add into container by usinghostPathinvolumesvolumeMounts:
- name: crypto-config
mountPath: <PATH IN CONTAINER>
- name: channel-artifacts
mountPath: /opt/gopath/src/github.com/hyperledger/fabric/peer/channel-artifacts
- nam... | Is there any way to share the directory/files to kubernetes container from your local system?I have a deployment yaml file. I want to share the directory without usingkubectl cp.I tried withconfigmapbut I later came to know that configmap can not have the whole directory but only a single file.If anyone has any idea pl... | Kubernetes share a directory from your local system to kubernetes container |
I went with this:H H(0-7) * * *which seems to be giving it a random time between 12 and 7 which is good for me. You could also do something like:def rand = Math.abs(new Random().nextInt() % 24) + 1;
triggers {
githubPush()
cron('H ' + rand + ' * * *')
}but seems extra as what I did worked. | Hi so right now I have a basic cron that runs my stuff twice a day at 1 and 6. Something like:H 1,18 * * *The problem is I have like 100 things kicking off at this time which is clogging up my machine. I want to randomly generate a time once a day for each job to run. It's ok if 5-7 are going at once. So I guess my que... | How to set up cron to run once a day at random times |
I found the answer for my question.yogesh's answergave me the hint to have a look at exporters and I found the other half of the answerhere.So on Prometheus UI, there is a list of exporters and their scraped endpoints (Status > Targets). If I call one of the endpoints, the response contains a description and the type o... | I'm building a dashboard in Grafana, using data from Prometheus, to monitor a namespace in a Kubernetes cluster. I need all this to see what happens during a load test.Now I've spent half my day looking for information about the different metrics in Prometheus. I've read throughPrometheus docsandkube state metrics docs... | Where can I find descriptions of Prometheus metrics? |
2
+25
The KeyManager attribute is currently not returned by Moto, you can either open an Issue on the Moto GitHub, or add it yourself (either locally, or PR'ed to upstream)
Share
Improve this answer
Fo... |
I want to create a key that's managed by AWS. So far this is what I have
@mock_kms
def test_mocking_getting_keys(self):
session = boto3.Session(profile_name=profile)
client = session.client('kms', 'us-east-2')
key = client.create_key(
Policy='string',
Description='string',
KeyUsage=... | How do you add KeyManager to a kms key mocked using moto |
Since you can access https://github.com/orgs/myorg/dashboard, you should be able to access the organization page on https://github.com/myorg.
However if you cannot access the organization page, contact GitHub Support and describe the problem you have.
|
Lately i have been having a problem with github.
after i create a new public organization, for instance: "myorg", i get an 404 error when trying to access it (https://github.com/myorg)
The only way i can access the organization is through the dashboard (https://github.com/orgs/myorg/dashboard)
But then i still can't a... | GitHub throws me to not found page whenever i create a new organization |
The docker-save-last-layer command line utility combined with docker build --squash is made to accomplish exactly this.
It exports only the last layer of the specified docker image.
It works by using a patched version of the docker daemon inside a docker image that can access the images on your host machine. So it doe... |
I can export images with
docker save -o <save image to path> <image name>
but this will pack all layers, and the file is big
is there a possibility to pack only layers which are not public available, so only the difference to the last public layer is exported?
| Docker save only non public layers |
I found the simplest and easiest way to shut down Vmmem is to go into Windows powershell / cmd and enter:wsl --shutdown. This shuts it down. | I am using Docker to run some containers on Windows 10, and when I was done I noticed an application named vmmem was using almost all of my ram: ~12GB. According tothisit is because of Docker and it said if I closed all docker images and containers it would stop. So I stopped and removed all Docker containers and image... | Stopping Vmmem from using RAM |
Change$servername = "localhost";to$servername = "mysql";. Your mysql service isn't on the localhost of your webserver container. You should use the name of the service instead | I have problem to connect to MySQL container.docker-compose.ymlversion: '2'
services:
mysql:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: JoeyW#1999
MYSQL_DATABASE: wiput
MYSQL_USER: web
MYSQL_PASSWORD: Web#1234
volumes:
-... | Docker Compose with PHP, MySQL, nginx connection issue |
To confirm setup:
apk update && apk add build-base unixodbc-dev freetds-dev
pip install pyodbc
Why install both unixodbc and freetds? Pyodbc's pip install requires the packages in unixodbc-dev and the gcc libraries in build-base, so no getting around that. The freetds driver tends to have fewer issues with pyodbc, an... |
I have an alpine based docker image, with support for Python, through which I am trying to connect to Azure SQL service. Here is my simple connection code.
import pyodbc
server = 'blah1.database.windows.net'
database = 'mydb1'
username = 'myadmin'
password = 'XXXXXX'
driver= 'ODBC Driver 17 for SQL Server'
conn = pyo... | Cannot connect to Azure SQL using an alpine docker image with Python |
0
if your build successed you can run
docker ps -a
to see all the working and stoped containers
and you can run
docker logs --tail=50 container-name
so you can see the container logs and start fixing the issue
Share
Improve this answer
... |
I build and run an Docker Container using sudo privilege to do so I ran bellow commands
This command to build the container and its build successfully.
sudo docker build -t getting-started .
After that I ran the docker container using bellow command
sudo docker run -dp 3000:3000 getting-started
After running the doc... | Docker Desktop in Ubuntu not showing containers those are build with sudo privilege |
I think the problem is not Github, the problem is your browser: if the file can be directly readed the it will, but if he cannot (like for binary file for example), then it will be downloaded. | What link to use to get automatic file download for text file from GitHub?This example works for binary files, but not for text based, like xmlhttp://github.com/downloads/TheHolyWaffle/ChampionHelper/ChampionHelper-4.jarFile is athttps://raw.github.com/Nodeclipse/eclipse-node-ide/master/ENodeIDE.p2fRelated toDownload b... | How to download text file from Github? |
Edit New Solution:The Amazon SDK Provides the Pre-Signed Url Feature.
With this you can generate temporary urls to one specific file only for your users.So the Use case scenario is this.
The S3 Images remain still private.
When a user requests his images, you pass all the links first to the Signing Handler which genera... | My web app uses Amazon S3 to store all the media files in my djagno web app with the help of the django-storages 3rd party app.My db handle the folder and files hierarchy and each user see just the links that belongs to his group.But! there is no permissions to the other folders at S3.for example:
user 1 : group is gro... | Restrict s3 file to Django group user |
3
HTTP Cookies do not contain any information regarding service IP address. They are tied to the domain name (or the root of the subdomain) and a path. Thus, you can change the service IP address all you want, as long as the domain stays the same. In your case both soluti... |
My team is coming to the end of a massive overhaul of changes to our system and are getting ready to do the big switch.
Currently, we are hosted on AWS using Elastic IPs. Our stack is Ruby on Rails and we are using capistrano.We also have a blackberry app and an iPhone app live and in the hands of customers. The authe... | Maintaining Cookies when switching EC2 instances Ruby on Rails |
You're misunderstanding the way windows' memory model works. The terminology and the documentation confuse things a bit which doesn't help.
When you commit memory, the OS is providing you with a "commitment" to providing a page to back that memory. It is not actually allocating one, either from physical memory or from... |
When I do VirtualAlloc with MEM_COMMIT this "Allocates physical storage in memory or in the paging file on disk for the specified reserved memory pages" (quote from MSDN article http://msdn.microsoft.com/en-us/library/aa366887%28VS.85%29.aspx).
All is fine up until now BUT:
the description of Committed Bytes Count... | Committed memory goes to physical RAM or reserves space in the paging file? |
1
Yes, that is correct. Each recursive step will use O(1) memory: function call overhead, and one pointer for each function parameter.
You can experimentally verify this by creating a large object (x = "x" * 1024 * 1024 * 100), then recursing on it a number of times and che... |
I just wanted to check if I understood Python's memory management correctly.
The following function would use O(j) memory, but not O(nj) memory, since the parameter n is a reference to the list, but not the list itself.
def cool(n,j):
if j == 0:
return
return cool(n,j-1)
Also, say this function was wr... | Understanding Python List Memory Usage In Recursive Calls |
There's a very good description here:
https://www.kernel.org/doc/gorman/html/understand/understand009.html
...the function alloc_pages() calls numa_node_id() to return the
logical ID of the node associated with the current running CPU. This
NID is passed to _alloc_pages() which calls NODE_DATA() with the NID
as... |
I do not understand what the memory node is in the kzalloc_node function. The description says, "allocate zeroed memory from a particular memory node." But what is a memory node? I am specifically looking at a portion of the deadline I/O scheduler (shown below).
static int deadline_init_queue(struct request_queue *q, ... | What is the memory node in kzalloc_node in the Linux kernel |
The problem is that the file is already part of the historical commit.You need to get back to the commit and amend it:# reset to previous commit but keeping content:
git reset --soft "HEAD^"
# potentially modify the tree content
# amend the old commit with the file removed:
git commit --amend
# push:
git push | I had a fileFthat exceeded 100 MB limit that I tried to push. So the push failed. I then removed the file, because it could not be pushed and assumed I needed to doadd . ; commitandpushagain. In the auto generated commit it saiddeleted file F. Uponpushit still tried to upload that file. Well ok, so I figured I need to ... | git tries to upload deleted file that is not staged |
The working directory of the cron is different from the directory you run the script directly.Make your bash script to use absolute path for python script files.Or make the bash script to change directory to where you run the script directly.ShareFollowansweredJun 24, 2015 at 11:32falsetrufalsetru363k6464 gold badges75... | I have a bash script to automate few things I do. The bash calls 2 python scripts, If I run the bash script normally, everything runs, no errors what so ever. I set up a cron job to Automate this and when I checked the logs I noticed the python scripts don't run at all. It gives me the following error.python: can't ope... | Crontab, python script fails to run |
Docker requires both hardware virtualization (configured in BIOS) and Hyper-V (configured in Windows) enabled on your machine.You can check if hardware virtualization is enabled with the PowerShell command(gcim Win32_ComputerSystem).HypervisorPresentIf false, you must enable hardware virtualization in your BIOS.After v... | My problem is that docker worked in my windows 10 up until yesterday after I re installed android studio to my computer. It keps on telling me that:Hardware assisted virtualization and data execution protection must be
enabled in the BIOS. Seehttps://docs.docker.com/docker-for-windows/troubleshoot/#virtualizationAnd I ... | Docker stopped working on windows 10 after installing android emulator |
The correct solution for this would be to set memory requests and limits correctly matching your steady state and burst RAM consumption levels on every pod, then the scheduler will do all this math for you.But for the future and for others, there is a new feature which kind of allows thishttps://kubernetes.io/blog/2020... | I have a tiny Kubernetes cluster consisting of just two nodes running ont3a.microAWS EC2 instances (to save money).I have a small web app that I am trying to run in this cluster. I have a singleDeploymentfor this app. This deployment hasspec.replicasset to 4.When I run thisDeployment, I noticed that Kubernetes schedule... | Can I force Kubernetes not to run more than X replicas of a pod in the same node? |
Using yaml folded style. The indention in each line will be ignored. A line break will be inserted at the end.Key: >
This is a very long sentence
that spans several lines in the YAML
but which will be rendered as a string
with only a single carriage return appended to the end.http://symfony.com/doc/current/comp... | I have a very long string:Key: 'this is my very very very very very very long string'I would like to express it over multiple shorter lines, e.g.,Key: 'this is my very very very ' +
'long string'I would like to use quotes as above, so that I don't need to escape anything within the string. | Docker-compose multi-line command [duplicate] |
Given that CloudFront currently does not let you directly restrict access (to the best of my understanding), I would do something like:
<video src="/media.php?v=my-video.mp4"></video>
Then your media.php file looks like:
if (isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] != 'my-site.com')
{
header('HTT... |
I'd like to allow anyone to play a video located in my s3 on my site as the src on a <video> tag but not allow people to use it as a src on their site or to play the video directly by typing the url into the browser bar.
I don't want people doing this:
and I don't want the following HTML to appear on http://your-site... | Prevent hotlinking of Amazon S3 files? |
Sadly, SonarQube does not fully support method-level metrics.However, you could give CodeAnalyzer plug-in a try:http://frontendart.com/products/codeanalyzer-for-sonarqube/McCabe's Cyclomatic Complexity is the metric your are looking for, I believe. I found an online demo for the plug-in (http://sonarqube.frontendart.co... | Apart from displaying complexity/function, can it be configured to display cyclomatic complexity of each method? This will help in quickly identifying potential refactoring candidates( methods) in large files with large number of methods. | Does sonarqube show cyclomatic complexity of a method? |
If you can usegnu-awkyou can make use ofFPATto specify the column data:awk -v FPAT='\\[[^][]*]|"[^"]*"|\\S+' '{
for(i=1; i<=NF; i++) {
print "$"i" = ", $i
}
}' fileThe pattern matches:\\[[^][]*]Match from an opening[till closing]using anegated character class|Or"[^"]*"Match from an opening till closing double q... | nginx access.log. It is delimited by 1) white space 2) [ ] and 3) double quotes.::1 - - [12/Oct/2021:15:26:25 +0530] "GET / HTTP/1.1" 200 1717 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36"
::1 - - [12/Oct/2021:15:26:25 +0530] "GET /css/custom.css HTTP/1.1... | How to parse logs ( nginx/apache access.log ) with mix of delimiters i.e. square bracket, space and double quotes? and optionally convert to json |
You can use this code in yourDOCUMENT_ROOT/.htaccessfile:RewriteEngine On
RewriteRule ^app_dev\.php(/media/cache/.*)$ $1 [L,R=301,NC]Reference:Apache mod_rewrite Introduction | I am using excellenthttps://github.com/liip/LiipImagineBundlebundle for showing images. But when working in dev enviroment, generated urls become something like:<img src="/app_dev.php/media/cache/60x60/somefile.jpg">and when there are 20-30 images, my programs crawls. I also get lots of connection timeouts because app_... | Use prod enviroment on some urls, while in dev env |
You are missingdiscovery.in the zen discovery settings. Try these settings:cluster.name: "localcluster"
network.host: _lo0:ipv4_
discovery.zen.ping.multicast.enabled: false
discovery.zen.ping.unicast.hosts: ["127.0.0.1:9300","127.0.0.1:9301","127.0.0.1:9302"] | I have a strange problem when trying to setup a local running elasticsaerch cluster. I have tried a lot of settings with the bind.host and the auto discovery but did not succeed. The strange thing is if I have my wireless connection connected to a network the two nodes do not see each other. If I switch it of I do not ... | How to create a local elasticsearch cluster on my mac |
You are trying to store a number greater than 2^31 in a signed 32 bit int. It does not fit. Use size_t instead for the size that you pass to malloc. Change the type of i to size_t.
|
On a 64 bit linux machine I wrote the following small C program:
#include <stdlib.h>
#include <stdio.h>
int main (void)
{
#define BLOCK_SIZE (1024*1024)
int i;
for (i = 1; ; i++)
{
char *p = (char *)malloc(i * BLOCK_SIZE);
if (p == 0)
break;
*p = 13;
free(p... | Allocation of more than 2gb fails on 64 bit binary |
val largeDf = someLargeDataframe.cache
val tinyDf = someTinyDataframe.cache
val newDataframe = largeDf.union(tinyDf).cacheIf you call unpersist() now before any action that goes through all your largeDf dataframe you won't benefit from caching the two dataframes.tinyDf.unpersist()
largeDf.unpersist()I wouldn't worry ab... | I have a large dataframe that has been cached likeval largeDf = someLargeDataframe.cacheNow I need to union it with a tiny one and cached it againval tinyDf = someTinyDataframe.cache
val newDataframe = largeDf.union(tinyDf).cached
tinyDf.unpersist()
largeDf.unpersist()It is very inefficient since it need to re-cached a... | Efficient way to join a cached spark dataframe with other and cache again |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.