Response
stringlengths
15
2k
Instruction
stringlengths
37
2k
Prompt
stringlengths
14
160
You could usethe caching that is used in ASP.NET and is also available in other .NET applications
Suppose I have a WCF service that is not session or singleton based and is set up as per call. The service needs some information from a file, but this information does not change and only needs to be read once. I don't want every call opening and reading the contents of the file for performance reasons. I would like to cache this data.How can I make make per call instance WCF service cache this information to avoid opening and reading the file with every call?Do I need a separate caching service/component? We are using .Net 4.One thing I have looked at is the possibility of using the AppFabric caching service, but maybe there is something simplier.
WCF Per Call Service, needs to implement caching.
Have you tried after the latest release? For some configuration combination the publish profile was getting generated incorrectly.
I am trying to publish a non-modified ASP.NET 5 project to my freshly installed Ubuntu 15.04 server, but I receive the following message: An error occurred during publish. AspnetPublishHandler with name "Custom" was not found I bound the server to the correct port with: docker daemon -H 0.0.0.0:5555 & The connection validation is successful. Anyone has an idea what could be wrong?
AspnetPublishHandler with name "Custom" was not found when publishing ASP.NET 5 project to Docker
There's now documentation available:https://github.com/kubernetes-sigs/aws-efs-csi-driver/blob/master/examples/kubernetes/access_points/README.md#create-access-points-in-efsYou'll need to be using the updated EFS CSI driver. The access point is defined under PersistentVolume'svolumeHandle. The recent EFS CSI driver no longer supports dynamic binding, hence, the PersistentVolume needs to be created manually for each PersistentVolumeClaim.apiVersion: v1 kind: PersistentVolume metadata: name: efs-pv1 spec: capacity: storage: 5Gi volumeMode: Filesystem accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain storageClassName: efs-sc csi: driver: efs.csi.aws.com volumeHandle: [FileSystemId]::[AccessPointId]
First of all to put some context on that question.I have anEKScluster with version >=1.15TheEFS-EKSsecurity group/mount targetetc. are working properlyTheCSIdriver forEFSinEKSis installed and work as expectedI have deployed a storage class calledefs-scusing theEFS CSIdriver as a provisionerI can access theEFSvolume on the podBut ... it only works if it is the root path/that is defined as the path in thekubernetespersistent volume resource definition.Example with Terraform 0.12 syntaxresource "kubernetes_persistent_volume" "vol" { metadata { name = "my-vol" } spec { capacity = { storage = "15Gi" } access_modes = ["ReadWriteMany"] storage_class_name = "efs-sc" persistent_volume_reclaim_policy = "Recycle" persistent_volume_source { nfs { path = "/" # -> OK it works properly # path = "/access-point-path" -> NOT WORKING server = var.efs-storage-apt-server } } } }When I try to specify the path of my access point the mounting of the volume fails.Theefsaccess point is configured like thisSo is it a limitation? Did I miss something?I was looking about this solutionefs-provisionerbut I don't see what this will solve from this current configuration.
Is it possible to use AWS EFS access points to mount a kubernetes persistent volume in EKS?
I fixed the problem by removing libcurl4-gnutls-dev and installing libcurl4-openssl-dev. If you have the same problem you just need this command :sudo apt-get install libcurl4-openssl-devThis removed libcurl4-gnutls-dev automatically.
I'm trying to send https requests (ssl) to an API server (Last.fm) with libcurl. When i try to send http requests it's OK but when i send https requests it isn't. After many searches in google and stack overflow i get this sample code from internet and try to execute it but it doesn’t work and show this error :curl_easy_perform() failed: Peer certificate cannot be authenticated with given CA certificatesthere is the sample code :#include <stdio.h> #include <curl/curl.h> #include <string.h> int main() { CURLcode res; CURL *handle = curl_easy_init(); char url[] = "https://google.com"; curl_easy_setopt(handle, CURLOPT_URL, url); res=curl_easy_perform(handle); if(res==CURLE_OK) { printf("OK"); } else{ printf("curl_easy_perform() failed: %s \n", curl_easy_strerror(res)); } return 0; }P.S: I'm compiling with gcc from my terminal.
SSL certificate issue C
Your DNS records don't have to be within the same domain as the one they host. If you are running your own DNS servers, they can live inside your primary domain. But if you're using another DNS provider like zoneedit.com or easydns.com, just use the hostnames they provide."Glue records" are the NS pointers that let the root servers find the DNS servers for a particular domain. For example, there might be:mysite.com NS dns1.example.com mysite.com NS dns2.example.com mysite2.com NS dns1.example.com mysite2.com NS dns2.example.comNote that this is entirely different from where your domain'sweb siteis served. For that, you just configure the DNS for each of these domains so that the IP address for the "www" host (and probably the domain itself) points to the same IP ... then you read your web server software's documentation on how to set up "named virtualhosts".Are you clear on the distinction between DNS hosting and web hosting? If not, I can go into more detail.
I have a server that already has a domain, lets say mysite.com but i want to put another site on it with the domain mysite2.com.So my questions are, how do i set up the nameserver settings.... My first domain i have listedns1.mysite.com ns2.mysite.comSo would it work if i used:ns1.mysite2.com ns2.mysite2.comfor my new site?Also, i have to set up "glue records". These are the ns1 and ns2 from the nameserver and provide the ip of my server. So for the mysite2.com would i use ns1.mysite2.com and then the ip would be for example 111.111.111.111/MYSITE2 ? Because the glue record for the first site is just 111.111.111.111.....?Hope this isn't to confusing, i'm just new to this stuff and want to understand it a bit better and i don't want to mess my original site up in anyway.thanks for the help.
Linking multiple domains to a server
You should ask GitHub to merge said pull request: that would be "accepting" it.You can do so from command-line, usinggh, the official GitHub clientSeegh pr mergegh pr merge <number>But that supposes that you did login first (for instance, using a token like yourPAT:gh auth login --with-token < mytoken.txt).Again, from command-line, without using GitHub web directly.But what if you want to accept WITHOUT merging, i.e. in the case of having multiple reviewers?Then you would need to usegh pr review:# approve the pull request of the current branch gh pr review --approveThat way, you can approve the pull request indicating that you are satisfied with the changes, while still leaving it open for other reviewers to provide their feedback before it gets merged.And, if you are part of a team project on GitHub, you might have protected branches set up which require multiple reviews before a pull request can be merged.In such setups, individual approvals can be done using the GitHub CLI as shown above, and the pull request will only be able to be merged once it has received the required number of approvals.
ProblemI received a pull request and I want to approve it via the command line (i.e., without logging into Github with my browser and using the GUI). This PR makes changes to a branch.This is what I tried:# First I go to the correct branch: git checkout branch-to-be-modified # Then I pull the changes made by the person who's contributing with the PR: git pull https://github.com/my-contributor/code.git his-branch # I then run `git status`, but it shows me nothing git status # Outputs: # > On branch branch-to-be-modified # > nothing to commit, working tree cleanQuestionHow do I accept the Github pull request through the command line?What else do I need to do, should I justgit push origin branch-to-be-modified?This should be easy, but I can't find this information. Thank you so much for any leads
How to accept pull requests (PR) from Github using command line git
FWIR if you leave the defaults then it won't create the profile since the defaults are allNONE.Your format is not quite correct for creating the profile configuration manually.It should be[profile example] region=eu-west-1 output=textShareFollowansweredAug 7, 2018 at 18:10CheruvianCheruvian5,73711 gold badge2424 silver badges3434 bronze badges0Add a comment|
I'm trying to setup an new named profile using the awscliI usedaws configure --profile exampleto set the profile up but I left everything as the defaultNow I'm gettingThe config profile (example) could not be foundI even tried creating and modifying the~\.aws\configfile with the following but to no avail[example] region=eu-west-1 output=textAny command I try to execute will result in the above errorI also tried reinstalling the awscliHelp is much appreciated, thanks!
AWS CLI: The config profile (example) could not be found
Your link is about endpoints which is only available in the old portal (https://manage.windowsazure.com). From your screenshot I see that you use the new portal (https://portal.azure.com).What you have to do is the following:1. In the new portal go to your VM and click on "All settings"2. Select "Network interfaces" and select the network interface with the public IP address. (Probably there is only one.)3. Select the "Network security group" and click on "All settings"4. Select "Inbound security rules"5. Click "Add" and create a new inbound rule with the following settings:Name: any name, e.g. "Web"Priority: any number lower 65500Source: any or InternetProtocol: any or TCPSource port range: *(important difference to your configuration)Destination: AnyDestination port range: 8080 (IIS' configured port)Action: AllowSave it, wait a minute, and that's it.And here are some screenshots for clarificationShareFolloweditedFeb 2, 2016 at 9:44answeredFeb 2, 2016 at 9:33Peter KirchnerPeter Kirchner81966 silver badges1212 bronze badges1Thank you, The origin of issue was source port range.–StivinFeb 2, 2016 at 10:02Add a comment|
I have a virtual machine on azure. On the VM with Windows Server 2012 I have a web-site which is published via IIS7. I wrote bindings for the web-site, changed a port to 8080 and now able to access it with it's ip: 10.0.0.4:8080. Now I want to have an access to this web-site via internet. My VM has static ip, for instance 1.2.3.4. I added a rule on my virtual machine for 8080 for windows firewall, to allow all connections for this port. I suppose now I need to edit binding on the azure manager, I read a lot of articles (e.g.https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-set-up-endpoints/) but I don't have 'Endpoints' menu. The only one I have is: inbound rules and outbound rules, so I've tried to do port-forwarding there (screenshot:http://take.ms/MgLWq). But it doesn't work, I still don't have access from the outside.Any suggestions? Thanks in advance
Azure port-forwarding issue
SIGEMTIt is the emulator trap. It results from certain some unimplemented instructions (i.e you are trying to give a instruction which is not implemented in GNU library) which might be emulated in software, or the operating system’s failure to properly emulate them.for memory space issue there was a mentioned hack on codechef blog, try to declare your variables before the main() function, so you will get a global variable declared on the heap.https://discuss.codechef.com/t/why-do-i-get-run-time-error-sigemt/15957
I get SIGEMT error in the codechef compiler for the following code: It works fine when I run the same code offline on my PC. I have read this occurs due to high memory usage oflong long int, but when I change it toint, I get SIGTSTP error instead, which indicates a lack of memory.#include <iostream> using namespace std; int main() { long long int t, i, j, count = 0; int flag = 0, gflag = 0; cin>>t; while(t--) { long long int n; cin>>n; long long int arr[n]; for(i = 0; i<n; i++) { cin>>arr[i]; } for(i = 0; i<n-1; i++) { count = 0; flag = 0; gflag = 0; if(arr[i] == 1) { for(j = i+1; j<n; j++) { if(arr[j] == 1) { gflag = 1; break; } count++; } } if(count<5 && gflag == 1) { cout<<"NO\n"; flag = 1; break; } } if(flag == 0) cout<<"YES\n"; } return 0; }Please help. Thank you.
How do I resolve SIGEMT runtime error in codechef?
0 If you have more than 8 KB of data, you had to switch the Data model to Large: ProjectProperties / Conf: / Memory model / Data model = Large Share Improve this answer Follow answered Aug 8, 2018 at 13:29 MikeMike 4,12666 gold badges2222 silver badges3939 bronze badges Add a comment  | 
I am trying to copy an array into another in PIC24 PIC24FJ256GB206 microcontroller with C30 compiler. Length of my array is more than 1500 bytes. Here is my code:- int i=0; int count = sizeof(rx.data.buff.fields.data); for(i=0;i<count;i++) { rec.data.data_block.data[i] = rx.data.buff.fields.data[i]; } But when I compile my code, I get this error:- build/SINGLE_PORT_BAUD57600/production/_ext/733800733/rdso_icd_0065.o(.text+0x1604)c:\program files (x86)\microchip\mplab c30\bin\bin\..\bin/pic30-elf-ld.exe: Dwarf Error: found address size '3', this reader can only handle address sizes '2', '4' and '8'. : In function `.LM403': : undefined reference to `_rec' make[2]: *** [dist/SINGLE_PORT_BAUD57600/production/StandaloneHCD.X.production.hex] Error 255 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 Clearly it's not a logic issue. But what can be the reason for this?and What is the solution? thanks
Unable to copy array in PIC24FJ256GB206 with C30 compiler
You would need to create the SSL cert like Yu-Ju Hong said, then you would have to tell ruby to use the certificate when connecting something likehttp://makandracards.com/makandra/1701-use-ssl-for-amazon-rds-mysql-and-your-rails-appThe bit about:sslca: /path/to/mysql-ssl-ca-cert.pem
I am usingKubernetesto deploy aRails applicationtoGoogle Container Engine.The database is usingGoogle Cloud SQL.I know the database's ip address and set it into my Kubernetes config file:# web-controller.yml apiVersion: v1 kind: ReplicationController metadata: labels: name: web name: web-controller spec: replicas: 2 selector: name: web template: metadata: labels: name: web spec: containers: - name: web image: gcr.io/my-project-id/myapp:v1 ports: - containerPort: 3000 name: http-server env: - name: RAILS_ENV value: "production" - name: DATABASE_URL value: "mysql2://[my_username]:[my_password]@[database_ip]/myapp"Then create:$ kubectl create -f web-controller.ymlFrom the pod log I saw:$ kubectl logs web-controller-038dl Lost connection to MySQL server at 'reading initial communication packet', system error: 0 /usr/local/bundle/gems/mysql2-0.3.20/lib/mysql2/client.rb:70:in `connect' /usr/local/bundle/gems/mysql2-0.3.20/lib/mysql2/client.rb:70:in `initialize' ...I can see theLoadBalancer Ingressip address from theKubernetes UIpage in web service section.From theGoogle Developers Console -> Storage -> SQL, select the running db and click the link. FromAccess Controler -> Authorization -> Authorized Networks, add a new item and add that IP to there. But the result was the same.
How to connect Google Cloud SQL from Google Container Engine?
What if you usedirname(__FILE__)(see) to get an absolute path to your "fileDirectory" directory ?Something like this in your script, I guess, if yourfileDirectoryis a child of the directory where your file resides :file_put_contents(dirname(__FILE__) . '/fileDirectory/' . $fileName, $fileContents);That way, you don't depend on relative path, which can be wrong if your script is not launched from the "right" directory.
I am trying to write a file to a sub folder of the directory my cron script is in using file_ put_ contents. However, I keep getting a warning "failed to open stream: No such file or directory." I have this directory structure:httpdocs/scripts/fileDirectoryThe cron script lives in the scripts folder. I call it with the cron command:php httpdocs/scripts/cron_writeFile.phpIn the cron_writeFile file, I first tried:file_put_contents('fileDirectory/', $fileName, $fileContents);which works when I load the page in a browser, but not when the cron executes.When I require_once a file in a cron, I have to put the 'absolute' path to it:require_once('httpdocs/scripts/requiredFile.php');So, I tried that:file_put_contents('httpdocs/scripts/fileDirectory/', $fileName, $fileContents);No luck. I'm pretty sure it's getting to the right folder because the warning is:"Warning: file_ put_ contents(httpdocs/scripts/fileDirectory/4.txt): failed to open stream: No such file or directory in /var/www/vhosts/myDomain.com/httpdocs/scripts/cron_writeFile.php on line 93"The both directories have write permissions.I am using a VPS running (I know it sucks and I need to upgrade, but I don't have the authority)Parallels Plesk Panel version 9.2.1 with PHP 5.0.4The file does not exist and I need a new file each time the script runs.I am not sure if there is a certain way to define the file path or some other thing I am missing.Thanks for your help!
Writing a file in PHP with a cron
Did you run the embedded scheduler? SeeRunning the Schedulersection inthe documentation:tab = CronTab(tabfile='MyScripts.tab') for result in tab.run_scheduler(): print "This was printed to stdout by the process."Because windows doesn't have a crontab process, you have to either feed your crontabs into an existing daemon or use this run_scheduler within your process to create a daemon for yourself.
I want to schedule a python script using the python-crontab module on Windows platform. Found the following snippet to work around but having a hard time to configure. Script namecronTest.py:from crontab import CronTab file_cron = CronTab(tabfile='filename.tab') mem_cron = CronTab(tab=""" * * * * * command """)Let's say, for example, I want to print date & time for ever 5 mins using the following script, nameddateTime.py:import datetime with open('dateInfo.txt','a') as outFile: outFile.write('\n' + str(datetime.datetime.now()))How do I executedateTime.pyand setup the cron job for every 5mins throughcronTest.py.
Scheduling Python script using Python CronTab on Windows 7
Linked lists are good for LRU caches. For indexed lookups inside the linked list (to move the entry to the most recently used end of the linked list), use a HashTable. The least recently used entry will always be last in the linked list.
I intended to implement a HashTable to locate objects quickly which is important for my application. However, I don't like the idea of scanning and potentially having to lock the entire table in order to locate which object was last accessed. Tables could be quite large. What data structures are commonly used to overcome that? e.g. I thought I could throw objects into a FIFO as well as the cache in order to know how old something is. But that's not going to support an LRU algorithm. Any ideas? how does squid do it?
What data structures are commonly used for LRU caches and quickly locating objects?
First of all AWS ELB does not provide a A record with an IP address and instead it provides a CName. Unfortunately a CName cannot be mapped to a naked domain in DNS configurations and as a work around, AWS provides an Alias for A record. However using Godaddy DNS, Alias to AWS resources such as ELB is not possible which limits using naked domain mappings to ELB. Therefore you need to delegate DNS management to Route53 hosted zone(Or atleast for the naked domain) having the name server forwarding which cost you around $0.5 per hosted zone month for the first 25 hosted zones. Since an IP address is available for an EC2, if you directly point an A record in Godaddy, it won't cost for DNS at AWS.
I have registered a domain in goDaddy.com and want the traffic to be sent to AWS route53. I have a ELB created I did the following steps In Route 53, created a HostedZone for my godaddy domain name which in turn gave me a NS record with 4 amazon DNS server names and an SOA record. Created a new "A" record with just the naked domain and Aliased it with Elastic LB In godaddy , in DNS management, If I use the ELB DNS name for "A" record, I get an error "Enter a valid IP address" where as if I give the EC2 public IP address for "A" record , I can see the index page . I have still not given the 4 NS record DNS server names in godaddy. Questions : How do I use ELB instead of using EC2 Public IP. If I use the NS values, does that means the domain is ported to AWS Route53 and I will be charged every month at AWS? If I use the EC2 IP address only in goDaddy ,then I will not be charged by AWS ? Hope I am clear on my question, if not please let me know I can explain further
AWS ELB and GoDaddy Domain working
Since 1.1.2 (commit), all the $httpConfig options are directly exposed in $resource action objects:return { Things: $resource('url/to/:thing', {}, { list : { method : 'GET', cache : true } }) };ShareFollowansweredApr 18, 2013 at 10:07NarretzNarretz4,8693333 silver badges4040 bronze badgesAdd a comment|
I'm new to angularJS and have a question about caching etc.I have a wizard with two steps, I want to be able to click back and next and have the forms still filled out as the user had them.In my page1Partial i have this:<li ng-repeat="pick in picks | orderBy:orderProperty"> <b><span ng-bind="pick.name"/></b> <input type="checkbox" ng-model="pick.checked" ng-click="updateBasket(pick)"> </li>When i go to the next page, then click back the checkboxs are cleared, and its because my RESful call to a java service is called again. How can I cache this response?From my controller, this hits my REST web service every time.$scope.picks = Pick.query();My serviceangular.module('picksService', ['ngResource']). factory('Pick', function ($resource) { return $resource('rest/picks/:id', {}, { 'save': {method: 'PUT'} }); });
AngularJS Caching a REST request
+50AWS provides anopaque implementationfor user context data.encodedDatais to be collected on device and not the server.The CognitoJavascript client SDKexposes a method to achieve this. It is provided for in theAmplify Android SDKYou can get transferencodedDatafrom client to server, then forward that in your request to Cognito.
In all AWS Cognito SDKs in most functions you can pass anUserContextDataparameter to feed Cognito's Advanced Security feature:$result = $client->forgotPassword([ 'AnalyticsMetadata' => [ 'AnalyticsEndpointId' => '<string>', ], 'ClientId' => '<string>', // REQUIRED 'SecretHash' => '<string>', 'UserContextData' => [ // <=================== THIS 'EncodedData' => '<string>', ], 'Username' => '<string>', // REQUIRED ]);This field expects someEncodedData.What should I put inUserContextDataand how do I "encode" it?When using anAdmin*function likeAdminInitiateAuthI can send unencoded fingerprinting data throughContextData:$result = $client->adminInitiateAuth([ [...] 'ContextData' => [ 'EncodedData' => '<string>', 'HttpHeaders' => [ // REQUIRED [ 'headerName' => '<string>', 'headerValue' => '<string>', ], // ... ], 'IpAddress' => '<string>', // REQUIRED 'ServerName' => '<string>', // REQUIRED 'ServerPath' => '<string>', // REQUIRED ], [...] ]);Thedocumentationdoes not help:
What should I use as Cognito's UserContextData => EncodedData?
2 For our Django application, we eventually tracked this down to memory exhaustion. This is difficult to track down because the AWS monitoring does not provide memory statistics (at least by default) and even if it did, its not clear how easy a transient spike would be to see. Additional symptoms included: We would often lose network connectivity to the VM at this point. /var/log/syslog contained some evidence of some processes restarting (in our case, this was mostly Hashicorp's Consul). There was no evidence of the Linux OOM detection coming into play. We knew the system was busy because the AWS CPU stats would often show a spike (to say 60%). The fix for us lay in judicious conversion of Django queries which looked like this: for item in qs: do_something() to use .iterator() like this: CHUNK_SIZE = 5 ... for item in qs.iterator(CHUNK_SIZE): do_something() which effectively trades database round-trips for lower memory usage. Note that CHUNK_SIZE = 5 made sense because we were fetching some database objects with big columns of JSONB. I expect that more typical usage might use a number several orders of magnitude larger. Share Improve this answer Follow answered Nov 1, 2021 at 12:29 Shaheed HaqueShaheed Haque 65466 silver badges1616 bronze badges 1 BINGO! Memory exhaustion. Thanks. – Kaniabi Nov 18, 2021 at 19:30 Add a comment  | 
I have a flask web-app that uses a gunicorn server and I have used the gevent worker class as that previously helped me not get [CRITICAL] WORKER TIMEOUT issues before but since I have deployed it on to AWS behind an ELB, I seem to be getting this issue again. I have tried eventlet worker class before and that didn't work but gevent did locally This is the shell script that I have used as an entrypoint for my Dockerfile: gunicorn -b 0.0.0.0:5000 --worker-class=gevent --worker-connections 1000 --timeout 60 --keep-alive 20 dataclone_controller:app When i check the logs on the pods, this is the only information that gets printed out: [2019-09-04 11:36:12 +0000] [8] [INFO] Starting gunicorn 19.9.0 [2019-09-04 11:36:12 +0000] [8] [INFO] Listening at: http://0.0.0.0:5000 (8) [2019-09-04 11:36:12 +0000] [8] [INFO] Using worker: gevent [2019-09-04 11:36:12 +0000] [11] [INFO] Booting worker with pid: 11 [2019-09-04 11:38:15 +0000] [8] [CRITICAL] WORKER TIMEOUT (pid:11)
CRITICAL WORKER TIMEOUT on gunicorn when deployed to AWS
How about a simple ip security rule in web.config?<system.webServer> <security> <ipSecurity allowUnlisted="false" denyAction="NotFound"> <add allowed="true" ipAddress="192.168.1.0" subnetMask="255.255.255.0"/> </ipSecurity> </security> </system.webServer>Just replace ipAddress and subnetMask to your VNet setup. You may also need to connect your web app to vnet first.https://azure.microsoft.com/en-us/documentation/articles/web-sites-integrate-with-vnet/
So heres the two approaches I noticed. Is there any other way that I am missing and is there a favored approach? Pretty much I have a webAPI that i want to run as a webAPP and I am trying to figure out the best way to keep it internal onlyOne way that seems somewhat involved is the followinghttps://azure.microsoft.com/en-us/documentation/articles/web-sites-integrate-with-vnet/the second way I noticed is the followinghttp://www.microsofttrends.com/2014/09/30/add-a-firewall-to-your-microsoft-azure-web-site/The latter looks quicker I am just wondering if there's a preferred way to go about this or a newer more standard way to do this?updateAs of 7/23/2015 this is not possible but the closest solution is the accepted answer. One would have to whitelist all of the public IP addresses inside of their vnets. The reason you cant specify the range of addresses in the Azure vnet is because azure websites currently run on the public internet and they have no concept of the vnet ranges. Thus they cannot see the private ip address ranges that vnets create so you cant specify them in the web.config.http://azure.microsoft.com/blog/2015/04/29/introducing-app-service-environment/may solve this in the future
Ways to restrict Azure Website / WebApp to only be view-able internally on a vnet
Found the simplest way to deal with this situation - Go to "settings" of the repository and change the default branch to the current branch. This will not affect anything unless you have some sort of trigger in place to deploy the current default branch.Once you get that done, dependabot should be able to scan for vulnerabilities and give you the results. You can flip it how many ever times you'd like.
I have a repository which uses ReactJS and has 39 vulnerabilities (all of them are in yarn.lock file) when I am on the master branch. Dev branch and a few other branches are many more commits ahead of this master and there are a ton more dependencies and most of them are outdated as of now. However, even when I switch the branch on GitHub (when I switch to Dev or something else), it still shows the same 39 vulnerabilities.So, does that mean GitHub is showing the vulnerabilities for the entire project in all the branches? Do I have to set some setting to look at the alerts/vulnerabilities only for the current branch? Or does it mean that all of the branches have the same vulnerabilities?Thanks in advance.
How to see dependabot alerts only for the current branch?
You don't have to wait to fix the errors. Because every commit in GitHub is sealed with a SHA1 hash code. If the project already had build errors, you can easily prove it. But before that, you must be absolutely sure that you are not facing with an environment problem.I would also suggest, asking the latest status of the project to the fellow team members. Before making any commitments, you can easily open an issue for the build errors and wait for an answer.Also if your findings are correct, this may be a very good chance to contribute!
I have a trivial question ongit(I'm not expert in git, but manage to do most of the tasks).I made a fork of a popular project on github, hoping to contribute to it and then request a pull of my changes to the main repo.After I cloned the repo onto my disk, I tried to build it as downloaded and found build errors.If I make changes to my local repo and request a pull to the master project, will it look as if I caused the build error?Or should I wait to fork a stable repo and make changes to it?
issue with forking an unstable repo on Github
I can't test this right now, but this piece of code stolen and modified fromhereusingSetEnvIfmight help:SetEnvIfNoCase Host "a.com" HTTP_MY_HAS_HOST Order Deny,Allow Deny from All Allow from env=HTTP_MY_HAS_HOSTyou can use regular expressions for the host name.
I have searched Google but couldn't figure out how to do this thing:How can I block access to a specific directory if the request is done on a specific host.Let me give an example. I havea.comandb.cometc. addresses pointing to the same document root (the/).I need to block the access to/sites/private/directoryunlessthe request is coming usinga.com. The/sites/private/directory should only be accessible if the request is done usinga.com.Thanks.
apache .htaccess mod_rewrite - blocking access to a directory unless the request is done using a specific host
121 Make sure you have the disable cache checkbox unchecked/disabled in the Developer Tools. Share Improve this answer Follow edited Feb 2, 2021 at 6:36 Rob Bednark 26.8k2424 gold badges8282 silver badges126126 bronze badges answered Jan 28, 2013 at 17:20 Sabrina LeggettSabrina Leggett 9,25977 gold badges4747 silver badges5050 bronze badges 4 5 This helped me solve the same issue. In-case you all are stuck, in the developer tools, click the gear icon at the bottom-right. – Kayla Sep 5, 2013 at 0:19 4 And to think I was about to write an image serving page, just to enforce cache control. THANK YOU!! – Reinstate Monica Cellio Oct 22, 2014 at 15:11 9 I just threw my arms up into the air demanding god to punish me for my stupidity. Also had cache disabled... – TheBokiya Nov 19, 2014 at 0:43 7 The problem existed between my keyboard and chair. – Travis D Jan 31, 2017 at 15:29 Add a comment  | 
When Chrome loads my website, it checks the server for updated versions of files before it shows them. (Images/Javascript/CSS) It gets a 304 from the server because I never edit external javascript, css or images. What I want it to do, is display the images without even checking the server. Here are the headers: Connection:keep-alive Date:Tue, 03 Aug 2010 21:39:32 GMT ETag:"2792c73-b1-48cd0909d96ed" Expires:Thu, 02 Sep 2010 21:39:32 GMT Server:Apache/Nginx/Varnish How do I make it not check the server?
Chrome doesn't cache images/js/css
I've just changed "true" instead of "on", for nginx ingress controller , and workd for me . As mentioned here :https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/apiVersion: v1 kind: ConfigMap metadata: name: nginx-configuration namespace: ingress-nginx labels: app: ingress-nginx data: enable-underscores-in-headers: "true"kubectl apply -f configmap.ymlenter image description here
I have a problem with headers not forwarded into my services, I am not sure how support for Ingress was added, however I have the following Ingress service:apiVersion: extensions/v1beta1 kind: Ingress metadata: name: my-ingress annotations: ingress.kubernetes.io/rewrite-target: / "nginx.org/proxy-pass-headers": "custom_header" spec: rules: - host: myingress.westus.cloudapp.azure.com http: paths: - path: /service1 backend: serviceName: service1 servicePort: 8080However, my custom_header will not be forwarded. In nginx I set underscores_in_headers:underscores_in_headers on;How can I add this configuration into my ingress nginx service?Thanks.
Enable underscores in headers on Azure ingress
The idea of a certificate for DEP is that Apple don't want to provide you the DEP token over SSL (unlike VPP token). To retrieve that, they ask that you provide a PEM formatted public key via their portal (this is basically anyopensslself-signed cert, like so:openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -days 365when uploading, usecert.pemfile)Then, when they return the result, use the private key to decrypt the CMS (PKCS7 Envelope):openssl smime -decrypt -inform pem -in fileFromApple.p7 -inkey key.pemNote that we use file from Apple and the key that we generated in the first command.Note: it has been over a year since i've done this in practice, but in principal these commands should work.
I am trying to follow the instructions for creating DEP Server Tokens in Apple's Device Enrollment Program manual (https://developer.apple.com/library/content/documentation/Miscellaneous/Reference/MobileDeviceManagementProtocolRef/4-Profile_Management/ProfileManagement.html) , but I don't really know how to "Generate a public/private key pair in PEM format for the MDM server"I have a certificate from a trusted certificate authority, but how do I create the certificates from that ?
Generate a public/private key pair in PEM format
To answer your question, yes you can do this with releases. GitHub releases are really just git tags. You can't (as far as I know) create a release with a PR, but you can use a tag:$ git checkout master $ git pull origin master $ git tag v1.2.3 $ git push origin master --tagsYou will now see v1.2.3 in your "Releases" section on GitHub. You can edit it to make it more verbose, attach binaries, etc.Tags don't work like branches, but you can make a branch from a tag easily if you ever need to.Make sure you've got the tags fetched:git fetch --all --tags --pruneThen check out the tag and create a new branch:git checkout tags/<tag_name> -b <branch_name>ShareFollowansweredJan 12, 2018 at 15:53Jamie CounsellJamie Counsell7,89066 gold badges4949 silver badges8282 bronze badges4Thanks Jaime, is there a way to include to a release an specific branch?–VAAAJan 12, 2018 at 16:04Hey @VAAA, I'm really not sure what you mean. You couldgit checkout <branch_name>, thengit tag v1.2.3thengit push origin <branch_name> --tags?–Jamie CounsellJan 12, 2018 at 16:57So you mean better to create a "release branch 1.0" from the release, and then I can merge my hotfix branch into that "release branch 1.0" right?–VAAAJan 12, 2018 at 16:59Yep, and only do that if you need to, so there are not branches for every release - only those that need a hotfix–Jamie CounsellJan 12, 2018 at 18:10Add a comment|
I have a project in Github where all the team uses Pull Request workflow. So each developer has a Fork of the master repository.The process for solving an issue of adding a new feature is the following:The developer creates a branch into his local repository (Fork from master)The developer starts working on the ticket for solving the issueOnce the developer finish the ticket, he commits the changes to his local repo and push the changes to his Fork in GithubThen, he request a Pull Request from that branch to MasterTeam leader access master repository and validates the Pull Request and accepts the changes and merge it to the master.When we are going to make a publish the code that is published comes from the Master repo but we want to make like a base line of the code that is in Master so any other Pull Request accepted and merged into Master doesnt change the code that we are going to Release.Does releases functionality from Github is something we can use to take a copy of Master repo code at some point and keep that code unchanged even if some new Pull Request is merged into master?
How to use Github releases feature using Pull Request workflow
Developer variables are variables that will never be visible to the user, but will exist in the generated code. If that's what you're looking for: there's no API for it, but here are some things you can do. If you want to reserve the name so that users can't accidentally override your variable, call yourGenerator.addReservedWords('var1,var2,...'). You can initialize the variable in your wrapper code. If you really want Blockly to both reserve and declare the variable for you, you could override the init function on your generator. On the other hand, if what you want is a user-visible variable that always shows up in the toolbox, without the user creating it, you should call yourWorkspace.createVariable('variable_name').
I want to create a Developer Variable to the workspace in Blockly, but I cannot find the necessary function/method. I do not want to create the variable over a button. The variable should be included even if there is no block in the workspace. With these two functions I can get the already created variables: var variables = workspace.getAllVariables(); var dev_var = Blockly.Variables.allDeveloperVariables(workspace); But what is the setting function?
Blockly How to create a Variable to the workspace (developer variable)
You can use the HTTP error code from the exception. BigQuery is a REST API, so the response codes that are returned match the description of HTTP error codeshere.Here is some code that handles retryable errors (connection, rate limit, etc), but re-raises when it is an error type that it doesn't expect.except HttpError, err: # If the error is a rate limit or connection error, wait and # try again. # 403: Forbidden: Both access denied and rate limits. # 408: Timeout # 500: Internal Service Error # 503: Service Unavailable if err.resp.status in [403, 408, 500, 503]: print '%s: Retryable error %s, waiting' % ( self.thread_id, err.resp.status,) time.sleep(5) else: raiseIf you want even better error handling, check out the BigqueryError class in the bq command line client (this used to be available on code.google.com, but with the recent switch to gCloud, it isn't any more. But if you have gcloud installed, the bq.py and bigquery_client.py files should be in the installation).
I have built a pipeline on AppEngine that loads data from Cloud Storage to BigQuery. This works fine, ..until there is any error. How can I can loading exceptions by BigQuery from my AppEngine code?The code in the pipeline looks like this:#Run the job credentials = AppAssertionCredentials(scope=SCOPE) http = credentials.authorize(httplib2.Http()) bigquery_service = build("bigquery", "v2", http=http) jobCollection = bigquery_service.jobs() result = jobCollection.insert(projectId=PROJECT_ID, body=build_job_data(table_name, cloud_storage_files)) #Get the status while (not allDone and not runtime.is_shutting_down()): try: job = jobCollection.get(projectId=PROJECT_ID, jobId=insertResponse).execute() #Do something with job.get('status') except: exc_type, exc_value, exc_traceback = sys.exc_info() logging.error(traceback.format_exception(exc_type, exc_value, exc_traceback)) time.sleep(30)This gives me status error, or major connectivity errors, but what I am looking for is functional errors from BigQuery, like fields formats conversion errors, schema structure issues, or other issues BigQuery may have while trying to insert rows to tables.If any "functional" error on BigQuery's side happens, this code will run successfully and complete normally, but no table will be written on BigQuery. Not easy to debug when this happens...
How to catch BigQuery loading errors from an AppEngine pipeline
2 You could have 3 parallel list and store rows id in one, column id in the other, value in the third. Once you are done with all entries, you could reorganize as needed, ex. sort by rows and columns. What is not described in your question is how do you need/want to represent the sparse matrix in the end? What do you need to do with it? This would affect the representation Share Follow answered Jan 17, 2012 at 17:19 DAFDAF 14511 gold badge22 silver badges1212 bronze badges Add a comment  | 
I know there are quite a few good ways to store a sparse matrix without taking up much memory. But I'm wondering whether there is a good way to store a sparse matrix during the construction of it? Here is the more detailed scenario: the program constructs a sparse matrix by figuring out where to put a non-zero value on each iteration; and since the coordinates of the non-zero value will not be known until runtime, they are totally random and unpredictable. I'm programming in C++. So is there a way to implement this in C++? Solutions in other languages are also appreciated.
How can I economically store a sparse matrix during the process of element filling?
You need to look at the pod logs for details.kubectl logs xray-daemon-x9m8l -pShould give some ideas if the crash was caused due to application failure. It could be due to many reasons-p option gives you the logs of a previously crashed pod.kubectl describe po xray-daemon-x9m8lMay also give you some ideas
Closed.This question does not meetStack Overflow guidelines. It is not currently accepting answers.This question does not appear to be abouta specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic onanother Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.Closed2 years ago.Improve this questionI have a container that has some pods , one of them failed calledxray-daemon-x9m8lfailed with errorBack-off restarting failed containerany hint why this happens
Kubernetes xray-daemon pod give error Back-off restarting failed container [closed]
This is not related to docker, but just normal behavior in vim. As the file is under user directory /home/cp, hence cp user will have all permissions. What wq! command does is to delete the the old one and put new content into /home/cp/hello.txt. You can quickly test it by creating one more file in the folder that cp has no full permission.
I was performing some experiments in Docker and found a strange behaviour. I was able to override the ownership of a file created with the root user inside the Docker with another user without root permissions. Below are the steps to reproduce it: $> docker run -dit ubuntu:16.04 bash $> docker exec -it cont_id bash $> apt update && apt install -y vim $> useradd cp -m $> vim /home/cp/hello.txt # Write some text and save it $> su cp $> cd ~/ && ls -latr; # Will list hello.txt with user and group as root $> vim hello.txt # Write some text and try saving it normally which will fail. # Try saving it with `:wq!` Voila, it is saved and the user and group to which the file belongs also change to the new user. I have done a terminal recording for this and the same is posted here.
Able to override the root permission of a readonly file with a non-sudo user
Make sure that npm is readingpackage.jsonfrom the place you're copying it to.
When m trying to craete image of react app with dockerenter image description herefile its saying...The command '/bin/sh -c npm install --silent' returned a non-zero code: 254Here is my dockerfile# Pull official base image FROM node:13.12.0-alpine # Set working directory WORKDIR /app # Add `/app/node_modules/.bin` to $PATH ENV PATH /app/node_modules/.bin:$PATH # install app dependencies COPY package.json ./ COPY package-lock.json ./ RUN npm install --silent RUN npm install[email protected]-g --silent # add app COPY . ./ # start app CMD ["npm", "start"]
The command '/bin/sh -c npm install --silent' returned a non-zero code: 254
I was having the same problem while importing the certificate in local keystore. Whenever i issue the keytool command i got the following error.Certificate was added to keystore keytool error: java.io.FileNotFoundException: C:\Program Files\Java\jdk1.8.0_151\jre\lib\security (Access is denied)Following solution work for me.1) make sure you are running command prompt in Rus as Administrator mode2) Change your current directory to %JAVA_HOME%\jre\lib\security3) then Issue the below commandkeytool -import -alias "mycertificatedemo" -file "C:\Users\name\Downloads\abc.crt" -keystore cacerts3) give the password changeit4) enter y5) you will see the following message on successful "Certificate was added to keystore"Make sure you are giving the "cacerts" only in -keystore param value , as i was giving the full path like "C**:\Program Files\Java\jdk1.8.0_151\jre\lib\security**".Hope this will work
I'm trying to connect a Java Web API via HTTPS; however, an exception is thrown:javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorExceptionI followed these steps which I learned from online keytool & SSL cert tutorials:I copied the HTTPS URL into the browser, downloaded the SSL certificates & Installed them in the browser using Internet Explorer.Exported the certificates to a path on my computer, the certificates were saved as.cerUsed the keytool's import option. The command below executed without any errors.keytool -import -alias downloadedCertAlias -keystore C:\path\to\my\keystore\cacerts.file -file C:\path\of\exportedCert.cerI was prompted for a password at the command prompt, which I entered then I was authenticated.Thecmdwindow printed some certificate data & signatures and I was prompted with the question:Trust this certificate?I answered yes.The cmd prompt displayedCertificate was added to keystoreHowever after that message, another exception was displayed:keytool error: java.io.FileNotFoundException: C:\Program files\...\cacerts <Access Denied>Finally when I checked the keystore , the SSL certificate was not added and my application gives the same exception I was getting earlier when trying to connect:(javax.net.ssl.SSLHandshakeException:sun.security.validator.ValidatorException)
Java Keytool error after importing certificate , "keytool error: java.io.FileNotFoundException & Access Denied"
In short, no: not at the SQL server end; it will of course load the data into memory if possible, and cache the execution plan - so subsequent calls may be faster, but it can't cache the results. Options: tune the plan; the sort sounds aggressive - could you perhaps denormalize some data or add an index (perhaps even a clustered index); there may be other things we can do with the query if you show it (but tuning without a fully working DB is guestimation at best) cache the results at the web-server if it is sensible to do so
There is a certain query that is being called from an ASP .NET page. I studied the execution plan of that query in Management Studio and 87% is for a sort. I badly need the sorting or else the data displayed would be meaningless. Is there anyway that I can request SQL Server to cache a sorted results set so it will return the data faster in consequent runs? Or is SQL Server smart enough to do the cache handling and am I doing mistake by trying to force it to cache results, if that is possible? Any relevant information will be highly appreciated and thanks a lot in advance :) UPDATE: I just read in an article that creating a View with a clustered index will increase performance because the index will persist the data in a view to disk. Is this true? How do i get about doing this? Any articles?
Can i request SQL Server to cache a certain result set?
As mentioned in "How to reach some commands on Github for windows", you best course of action would be to use to git CLI (command line interface), opening a shell from "GitHub for Windows", or using msysgit. Then a git reset HEAD^2 (or even git reset --hard HEAD^2 if you really want to remove those files as well as any work in progress) would drop those commits (as in "How do I delete unpushed git commits?" or "How to delete a 'git commit'"). After a refresh, GitHub for Windows should display no more unsynced commit. Other answers below mention the recent addition of "Undo most recent commit", which achieve the same reset: As I mentioned in "GitHub undo a discard", the "discard changes" feature would achieve the same as a git reset.
I have two unsynced commits using GitHub (Windows), but don't want to commit them now. How can I revert or drop them?
How to remove unsynced commits in github for windows?
Is it possible you do not have mod_headers enabled?Secondly I think you may want to put the IfModule block outside the FilesMatch block. Like so# Allow access from all domains for web fonts <IfModule mod_headers.c> <FilesMatch "\.(eot|font.css|otf|ttc|ttf|woff)$"> Header set Access-Control-Allow-Origin "*" </FilesMatch> </IfModule>Code taken directly fromhttps://github.com/h5bp/html5-boilerplate/blob/master/.htaccess#L45
Our assets are in a sub domain and in order to overrun security features of our platform so we can add a Json query we have to add the following htaccess code<FilesMatch "\.(ttf|otf|eot|woff)$"> <IfModule mod_headers.c> Header set Access-Control-Allow-Origin "*" </IfModule> </FilesMatch> Header add Access-Control-Allow-Origin "*"However the last line "Header add Access-Control-Allow-Origin "*"" creates an internal server error on my local machine, which is odd because we do not get the same error on our prod environment. We are using Apache 2.2.22 php 5.4.3.Any help is appreciated thanks.
Header add Access-Control-Allow-Origin "*" causes internal server error
Typically one just follows it with a remote and a branch:git push <remote> <branch>If you cloned it from your own github repo, then the remote you want is likelyoriginand the branch you want is likelymaster, i.e.git push origin masterThe full range of options can be seen withgit push --help
I'm using github to get some code up. However, I'm having trouble with the git commands. To be clear, once I am on my folder, to push it to my repo and branch. I used:git add . git commit -m "changed xyz" git push (name of branch?)
I tried looking online, but doesn't specify what follows "git push "
With your shown samples, could you please try following. Since you are using very generic regex(not giving any uri condition in it) so its not reaching to your last rule of blog page. Keep it as your first rule like as follows. I have also fixed your regex in your all existing rules.Please make sure to clear your browser cache before testing your URLs.###Making Rewriteengine ON here. RewriteEngine ON ##Placing rule for URIs starting from blog here. RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^blog blog.php [NC,L] ##Placing rule for url like: http://localhost:80/test1/test2/test3 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(?:[^/]*)/(?:[^/]*)/(?:.*)/?$ product.php [L] ##Placing rule for url like: http://localhost:80/test1/test2 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(?:[^/]*)/(?:.*)/?$ results.php [L] ##Placing rule for url like: http://localhost:80/test1 RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^ results.php [L] ErrorDocument 404 http://www.example.com/404.php
I want to redirect this URLhttp://www.example.com/blog/Title-hereto myblog.phppagePlease noteTitle-herecan be anything.How I can do that ?I am trying following but it's not working.RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^blog/(.*)/?$ blog.php [NC,L]I don't know why.Following is my full .htaccess code, may be here's the issue.RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/(.*)/(.*)/?$ product.php [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/(.*)/?$ results.php [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/?$ results.php [NC,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^blog/(.*)/?$ blog.php [NC,L] ErrorDocument 404 http://www.example.com/404.php
Redirect Rule in .htaccess php
29 Despite the misleading/broken github interface there's actually a way to get what you want. You need to drop one . Instead of: https://github.com/account/repo/compare/ath/branchA...branchB do https://github.com/account/repo/compare/ath/branchA..branchB This compares branch heads instead of simply using the base branch to find the merge base. github's reponse is what clued me in from @edwin-evans' response: This is a result of the type of diff we use on GitHub. We use git’s three dot diff, which is the difference between the latest commit on the HEAD branch and the last common ancestor commit with the base branch. Share Follow edited Jan 29 at 15:22 answered Apr 4, 2022 at 17:11 CatskulCatskul 18.4k1515 gold badges8686 silver badges116116 bronze badges 3 1 Based on below official doc 1. Create new branch x from base branch 2. Merge your branch into branch x 3. Check the pull request diff between base branch and x branch, the diff show work as expected docs.github.com/en/pull-requests/… – Guizhou Feng Aug 24, 2022 at 9:51 But why Github chooses three dots instead of two dots? When merged, two dots diff is the effective one, isn't it? – Roeniss Mar 30, 2023 at 12:41 Never mind. I found the reason : "Since the three-dot comparison compares with the merge base, it is focusing on 'what a pull request introduces'. When you use a two-dot comparison, the diff changes when the base branch is updated, even if you haven't made any changes to the topic branch." – Roeniss Mar 30, 2023 at 12:47 Add a comment  | 
I am having two branches: - master and - develop. I am trying to merge branch develop into master branch. I have checked with Tower and Araxis merge, those two branches are identical. But when I do a pull request on Github, I am seeing that there are 381 files changed, like files are not on master at all. Any ideas why this behavior? Update: I am attaching screenshot of pull request.
Github pull request shows wrong diff
I had the same problem for a long time. Instead of https://hub.docker.com/repository/docker/songkong/songkongdockerdev use https://hub.docker.com/r/songkong/songkongdockerdev Fill in your docker hub username and password.
Usually I have a public Dockerfile that I build with public DockerHub repository (songkong/songkong), then I can run it on my Synology by just searching for the tag in the registry but I am making some changes in my private DockerHub repo (songkong/songkongdockerdev) before public release. I have built image okay in Dockerhub, and I guess I use Image/Add from Url in Synology but I cannot get the syntax correct for the Hub Page or Repository field, I tried a few things such as https://hub.docker.com/repository/docker/songkong/songkongdockerdev songkong/songkongdockerdev songkongdockerdev/latest what should it be ?
How do I use a private Dockerhub image from my Synology NAS
Use the--pushoption ofgit remote set-url.Assuming you'd cloned from the read-only repo:Before$ git remote -v origin git@<read-only-git>.com:org/repo.git (fetch) origin git@<read-only-git>.com:org/repo.git (push)Commandgit remote set-url --push origin git@<read-write-git>.com:org/repo.gitAfter$ git remote -v origin git@<read-only-git>.com:org/repo.git (fetch) origin git@<read-write-git>.com:org/repo.git (push)
I have a Jenkins project which has a git checkout url. The Jenkins master is configured with git-Jenkins plugin version 2.2.10_2 (https://wiki.jenkins-ci.org/display/JENKINS/Git+Plugin).I wanted to check if there is any way to provide different git remotes for fetch and push.e.g: $ git remote -v origin git@<read-only-git>.com:org/repo.git (fetch) origin git@<read-write-git>.com:org/repo.git (push)The use case here is to use a read only source for clones and push any changes back to a read-write source. There is an external synchronization mechanism to update the read only copy.Thank you,-Mayur
Jenkins git plugin: How to configure different fetch and push git remotes?
The official AWS RDS documentation covers this.Read the\copycommand section at the bottom of the page.You can run the \copy command from the psql prompt to import data into a table on a PostgreSQL DB instance.target-db=> \copy source-table from 'source-table.csv' with DELIMITER ',';
I'm facing the following problem: I have an instance (RDS) on AWS to store some data, and I want to upload some data from my local pc to it! Using PgAdmin it seemed such an easy task, but I have to be a superuser in order to use the command 'COPY' that everywhere in the internet says!Sadly, for security reasons AWS blocks you from having those kinds of permissions, which is making my task difficult.I'm looking to see if anyone can come up with any solution, as getting the file to the same instance the database is running is impossible to me.Thank you!
Upload a local CSV to a Remote Postgre (AWS)
kubernetes: 1.24.0dashboard: 2.6.0Manually create a service account API token.https://github.com/kubernetes/dashboard/blob/master/docs/user/access-control/creating-sample-user.mdShareFollowansweredJun 14, 2022 at 3:47YcongYcong5611 bronze badgeAdd a comment|
I installed kubernetes according to thismanual + containerd, installed the kubernetes dashboard according tothis manualand created service account forthis manual, but when I try to look at the token, the console does not display it.enter image description here
Kubernetes Dashboard not show admin token
Most time, you don't need to add this property. It's used to set the user and the SSH Public Keypair when you want to SSH into the nodes to take a check or do something you want.Hereis an example. At this time, you need to deploy the extension to add the SSH Key. So you don't need to add the property, if you need, deploy the extension, it also works.
I am currently writing an ARM (Azure Resource Manager) template that creates a Kubernetes cluster. Therefore I am using the templates of existing clusters to compare if I am missing anything. This way I discovered that one of my existing Kubernetes clusters (created in the portal) has the linuxProfile property (as shown below) while the other does not. Now I can not seem to figure out for what exactly I need this user. I can create and use a new cluster with or without this property. Does anyone know when I need this user and if there are any security vulnerabilities if I do not use it (maybe because of missing ssh)?Thedocumentationdoes not help with this, as it only says that this is the administrator for Linux VMs. But it does not specify which VMs are meant (maybe the Kubernetes Nodes? Where would I need a user for them)?The Kubernetes ARM Quickstartguidealso has this property but does not explain it in more depth.... "properties": { ... "linuxProfile": { "adminUsername": "azureuser", "ssh": { "publicKeys": [ { "keyData": "ssh key" } ] } } } ...
When is the linuxProfile Property needed in Azure Resource Manager?
Ah, I solved the issue. It was not necessary to release any resources after callingtune.run(), the memory issue was due to building a tensorflow graph within each iteration. I realised that, quite annoyingly, the only way to release resources allocated by tensoflow is to terminate the python interpreter (closing the tensorflow session does not release them). I therefore wrote a script for building and training the graph, which I call usingos.system(). Quite hacky, but I am not aware of any other solutions.
I have a python script that trains a reinforcement learning model using, among others, the librariesrayandrllib. The script uses check-pointing to update anrllib.PPOmodel iteratively. In every iteration, I redefine the configuration and calltune.run(), where I provide the checkpoint of the previous iteration to the restore variable. For each call totune.run(), I only request one worker. Before entering the loop I initialize ray and request a large number of resources.The problem is that memory increases quickly, untilraycomplains that the workers do not have enough memory and comes to a halt. Using htop, I can see that my python script goes from 6% to 80% within the first 10 iterations. I am wondering how I can release the resources at the end of each iteration, so that memory usage does not increase with running time.Here's a (pseudo)code of my script:initialize rayray.init(object_store_memory=50000000000, memory=50000000000)training loopfor iteration in range(niterations): new_config = ... prev_checkpoint = ... tune.run('PPO', restore= prev_checkpoint, config=new_config)As you can see, I am not currently doing anything to release resources. Also, callingray.init()within the loop gives an error indicating that multiple calls of it are not possible. Finally, requesting more memory at the beginning is not possible and would not solve the problem, as I would like to perform thousands of iterations while keeping memory usage constant.
Ray: Memory management when calling tune.run() multiple times within python script
After searching for roughly 7 hours, I was finally able to find a solution to this issue in the Nginx forum:Nginx connet to .sock failed (13:Permission denied) - 502 bad gatewayWhat I simply did was changing the name of the user on the first line in/etc/nginx/nginx.conffile.In my case the default user waswww-dataand I changed it to myrootmachine username.
I'm deploying my Djano application on a VPS and I'm following the steps in the below link to configure my app with Gunicorn and Nginx.How To Set Up Django with Postgres, Nginx, and Gunicorn on Ubuntu 16.04Everything went well with the tutorial (gunicorn and nginx are running) but the issue is that when Im' visiting the VPS through the static IP its showing a white screen that is always reloading.After checking nginx log I found the following:(13: Permission denied) while connecting to upstream, client: , server: , request: "GET / HTTP/1.1, upstream: "http://unix:/root/myproject/myproject.sock:/", host: "", referrer: "http:///"
Nginx (13: Permission denied) while connecting to upstream
This is happening because the files in question are already in source control. You can remove them with git rm --cached myFile.txt. After that, they will indeed be ignored. A word of caution, though: others who pull the repo after you have pushed your changes will have their local copies of said files deleted in their working directory, so they will probably want to make a backup first.
This question already has answers here: How do I make Git forget about a file that was tracked, but is now in .gitignore? (35 answers) Closed 8 years ago. This is happening and i can't understand why User-MBP:Project user$ git status On branch playlist Your branch is ahead of 'origin/playlist' by 1 commit. (use "git push" to publish your local commits) Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git checkout -- <file>..." to discard changes in working directory) modified: Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist modified: Project/TPSettings.plist no changes added to commit (use "git add" and/or "git commit -a") User-MBP:Project user$ cat .gitignore SubModules/ .DS_Store Project.xcodeproj/project.xcworkspace/xcuserdata/user.xcuserdatad/UserInterfaceState.xcuserstate Project.xcodeproj/xcuserdata/user.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist User-MBP:Project user$ The file is in the .gitignore so it shouldn't be telling me to commit the file.
.gitignore is not working properly with iOS project [duplicate]
I suggest you have one Stack that creates only the KMS and export its value on the outputs: Resources: KmsKey: Type: AWS::KMS::Key Properties: ... Outputs: S3KmsKeyId: Description: The KMS Key used Value: !Ref KmsKey Export: Name: S3KmsKeyId Then you can have a second Stack that only creates the S3 Bucket, where you reference the Exported Value: Resources: S3Bucket: Type: AWS::S3::Bucket Properties: ... BucketEncryption: ServerSideEncryptionConfiguration: - ServerSideEncryptionByDefault: KMSMasterKeyID: !ImportValue S3KmsKeyId SSEAlgorithm: aws:kms
Given a CloudFormation template that defines: A KMS Key A KMS Key Alias An S3 bucket If for some reason I need to delete the CloudFormation stack and re-deploy, the deletion retains the KMS Key and Alias that was created. (This is sensible, I don't want to lose my key everything was encrypted with). But this means when I re-deploy the stack it fails because an Alias with that name already exists. I can delete the Alias through the CLI and re-deploy which will create an Alias for a new KMS Key. Is there a way for the CloudFormation stack to use the existing KMS key from the initial deployment? Also: I’m not 100% clear on what would happen for encrypted data in an S3 bucket that has it’s alias changed, does AWS know to automatically look for the previous KMS key it was encrypted with or does a re-encryption take place?
CloudFormation KMS Encryption Questions
2 The old large file is likely still part of your local Git history and as you know, the whole history of the branch is pushed. You'll need to make sure it isn't in an earlier commit either, eg by reset ing back to a commit where the video isn't there, then committing only the new smaller one. Share Improve this answer Follow answered Feb 5, 2021 at 6:37 AKXAKX 160k1616 gold badges127127 silver badges190190 bronze badges Add a comment  | 
I am creating a GitHub pages, I already deploy the react app to GitHub pages with custom domain. Earlier there is a file over 100MB, but when I came to know that GitHub allows only 100MB, I replaced that file with a 29MB file. When I am pushing the new changes to GitHub master branch using "git push origin master" I am getting an error see the attached image
Why 'git push origin master' is pushing old files to GitHub?
You can set a header value to void and Nginx will drop it :proxy_set_header Sec-WebSocket-Extensions "";
I have a Nginx websocket reverse proxy and I would like to hide a HTTP header from the client request.proxy_hide_header hides the server response headers and can't be used for hiding client request headers.I would like to do that because the websocket server behind nginx doesn't work well with the websocket extension "permessage-deflate" so I would like to remove the Sec-WebSocket-Extensions header from client requests.
Hide a client request header with a Nginx reverse proxy server
I found the solution, The problem was in the line endings. My file had inconsistent Line endings. some lines ends with\r\nand another ending with\ror\n. This hapend because I generated a sql script since SQL Management Studio.normalize inconsistent line endingsThe solution was in SQL Management Studio too.
I'm running this commanddocker run --network=foo --rm -v C:/Users/xxxx/Documents/flyway/sql:/flyway/sql flyway/flyway migrate -user=sa -password=MyPassword001 -url="jdbc:sqlserver://sqlserver-test:1433;databaseName=master"And I've got this error.Flyway Community Edition 6.0.1 by Boxfuse Database: jdbc:sqlserver://sqlserver-test:1433;useBulkCopyForBatchInsert=false;cancelQueryTimeout=-1;sslProtocol=TLS;jaasConfigurationName=SQLJDBCDriver;statementPoolingCacheSize=0;serverPreparedStatementDiscardThreshold=10;enablePrepareOnFirstPreparedStatementCall=false;fips=false;socketTimeout=0;authentication=NotSpecified;authenticationScheme=nativeAuthentication;xopenStates=false;sendTimeAsDatetime=true;trustStoreType=JKS;trustServerCertificate=false;TransparentNetworkIPResolution=true;serverNameAsACE=false;sendStringParametersAsUnicode=true;selectMethod=direct;responseBuffering=adaptive;queryTimeout=-1;packetSize=8000;multiSubnetFailover=false;loginTimeout=15;lockTimeout=-1;lastUpdateCount=true;encrypt=false;disableStatementPooling=true;databaseName=master;columnEncryptionSetting=Disabled;applicationName=Microsoft JDBC Driver for SQL Server;applicationIntent=readwrite; (Microsoft SQL Server 14.0) ERROR: Unable to calculate checksum for V1.1__My_description.sql: Input length = 1The file's content is very simple. I create a table.I'm using Flyway Community Edition 6.0.1 by Boxfuse
Flyway Error - When I run migrate command. I get "Unable to calculate checksum"
Thesecrets definition in the docker-compose.yml file, as of version 3.3 of the file format, does not support passing the content of the secret inside the docker-compose.yml file itself. The secret needs to be either external (predefined withdocker secret create secret_name -) or from the contents of a separate file.The syntax with an externally defined secret is:secrets: my_first_secret: file: ./secret_data my_second_secret: external: trueAnd the syntax for a separate file containing your secret is:secrets: my_first_secret: file: ./secret_data my_second_secret: external: name: redis_secret
I need to store the server_key_rsa of my sftpServer in a docker-compose.yml but I don't know how to store itIt's look like that for now :-----BEGIN RSA PRIVATE KEY----- ***********************My Key bla bla bla....... ********************************************** ********************************************** ********************************************** ********************************************** -----END RSA PRIVATE KEY-----And I would like to store it like that:server_key_rsa = Here should be the key.I tried with "|" just before my key, I tried to change my key file to Base64, I tried "\n" between lines, I tried "the\nrsa\nkey", but those solutions failed..Any idea please ?
How to store server_key_rsa in docker-compose.yml?
This bug is tracked bySONARMSBRU-199which was fixed in the Scanner for MSBuild v4.1.The bug report as mentions a workaround for excluding a single file.FYI support for MSBuild 12 was dropped in the Scanner for MSBuild v4, so if you upgrade the version you will need to make sure you are using a compatible version of MSBuild.ShareFollowansweredSep 3, 2018 at 10:40duncanpduncanp1,57211 gold badge1010 silver badges88 bronze badges1Thanks duncanp for the quick response. The link is exactly the problem we're having. Unfortunately, we're still using TFS 2015 Update 3 which has old version of "SonarQube Scanner for MSBuild" vNext task which uses older version of SQ Scanner. I may just copy the task to create a completely new one with updated SQ SCanner to fix it. In the meantime, I will try using the workaround of using <SonarQubeExclude> tag.–WayneSep 5, 2018 at 16:14Add a comment|
When analyzing C# project with TFS 2015 vNext build, I get the following error:The folder 'D:\Builds_Agent1_work\4\s\System\IPS\Files\Logo\MasterDesigns\Logo_11_Seal_of_Pinellas_County' does not exist for 'DEV_ScriptAdvisorPBM_SonarQube:DEV_ScriptAdvisorPBM_SonarQube:9C5E1BB5-E446-45C8-9CE6-5F9896D0D063' (base directory = D:\Builds_Agent1_work\4\s\System\IPS)I think it's because there is a file called "Logo_11_Seal_of_Pinellas_County,_Florida.png" but SonarQube thinks it's "Logo_11_Seal_of_Pinellas_County".I tried/d:sonar.exclusions=**\MasterDesigns\*to ignore the entire directory where "Logo_11_Seal_of_Pinellas_County,_Florida.png" is located but still same error.Any suggestions to fix this issue? Thx.SonarQube 6.5 C# plugin.
File does not exist in SonarQube analysis
There is no need in TeamCity GitHub hook, you can go with simple VCS trigger.Allactive brancheswill be triggered on first start. Fromdocs:A branch considered active if:it is present in the VCS repository and has recent commits (i.e. commits with the age less than the value ofteamcity.activeVcsBranch.age.daysparameter, 7 days by default). or ithas recent builds (i.e. builds with the age less than the value ofteamcity.activeBuildBranch.age.hoursparameter, 24 hours by default).Try to just wait until it's done or cancel all builds.Hope it helps.
I want to build each pull request merged with master. I have setup teamcity the following way:http://blog.jetbrains.com/teamcity/2013/02/automatically-building-pull-requests-from-github-with-teamcity/Branch specification:+:refs/pull/(*/merge)Default branch: masterI have setup github teamcity Service Hook.http://www.jaxzin.com/2011/02/teamcity-build-triggering-by-github.htmlWhen I enable the teamcity hook. The job recognizes the change but the build stays in 'pending' and is not triggered. Do I need to setup a VCS Trigger?I tried setting-up without the teamcity service hook, but builds for all the Pull-Requests are re-triggered whenever a new PR is submitted. The builds also get triggered on PRs which are closed.Can someone please share their configuration to trigger the build only once and not build any closed PRs?
Teamcity trigger builds for github pull-requests
+25In the previous version of Boto, there was a helper class namedHiveStepwhich made it easy to construct the a job flow step for executing a Hive job. However in Boto3, the approach has changed and the classes are generated at run-time from the AWS REST API. As a result, no such helper class exists. Looking at the source code ofHiveStep,https://github.com/boto/boto/blob/2d7796a625f9596cbadb7d00c0198e5ed84631ed/boto/emr/step.pyit can be seen that this is a subclass ofStep, which is a class with propertiesjarargsandmainclass, very similar to the requirments in Boto3.It turns out, all job flow steps on EMR, including Hive ones, still need to be instantiated from a JAR. Therefore you can execute Hive steps through Boto3, but there is no helper class to make it easy to construct the definition.By looking at the approach used byHiveStepin the previous version of Boto, you could construct a valid job flow definition.Or, you could fall back to using the previous version of Boto.
Is it possible to carry out hive steps using boto 3? I have been doing so using AWS CLI, but from the docs (http://boto3.readthedocs.org/en/latest/reference/services/emr.html#EMR.Client.add_job_flow_steps), it seems like only jars are accepted. If Hive steps are possible, where are the resources?Thanks
Boto3 EMR - Hive step
With this line:Route::controller('faq', 'StaticPagesController@faq');You are telling Laravel that the controller forfaqshoule beStaticPagesController@faq. TheRoute::controllermethod sets an entire controller for a route, it does not specify a method to be used on that route, Laravel handles this internally. Take a look at your error to prove my point:Class App\Http\Controllers\StaticPagesController@faq does not existIt is looking for classStaticPagesController@faqnotStaticPagesControlleras you are intending.Unless you are building an API using REST, you should not use thecontrollermethod and instead specify your routes explicitly, i.e.Route::get('faq', 'StaticPagesController@faq');This will use thefaqmethod on your controller when the user makes a GET request to the URIfaq. If you insist on using thecontrollermethod, then remove the@faqfrom the second argument and you will be good, although I'm pretty sure Laravel expects the methodsindex, show, create, etcto be in your controller. I suggest taking a look at theLaravel 5 Fundamentalsvideo course to help you get a better understanding.
I cloned thistodstoychev/Laravel5Starterfrom Github and installed it.After creating thisStaticPagesControllercontroller and updating my routes.php file. The controller does not seem to work. For some reason i keep getting the following error.ReflectionException in ControllerInspector.php line 32: Class App\Http\Controllers\StaticPagesController@faq does not existMy routes.php file<?php // Admin routes Route::group(['prefix' => 'admin', 'namespace' => 'Admin'], function () { Route::controller('permissions', 'AdminPermissionsController'); Route::controller('settings', 'AdminSettingsController'); Route::controller('roles', 'AdminRolesController'); Route::controller('users', 'AdminUsersController'); Route::controller('/', 'AdminController'); }); // Public and user routes Route::controller('contacts', 'ContactsController'); Route::controller('users', 'UsersController'); Route::controller('/', 'IndexController'); Route::controller('faq', 'StaticPagesController@faq');My StaticPagesController.php file<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use App\Http\Controllers\Controller; class StaticPagesController extends Controller { public function faq(){ return 'this is faq page'; } }I have triedcomposer update,php artisan acl:update,composer dumpautoloadto no avail.Please help me. Thanks
ReflectionException Class App\Http\Controllers\StaticPagesController@faq does not exist Laravel-5
Read this threadIs Safari on iOS 6 caching $.ajax results?You could disable the caching on webserver level and by using timestamps in the URL.ShareFolloweditedMay 23, 2017 at 11:47CommunityBot111 silver badgeansweredOct 9, 2012 at 9:05Simon EdströmSimon Edström6,52177 gold badges3232 silver badges5252 bronze badgesAdd a comment|
This question already has answers here:Closed11 years ago.Possible Duplicate:Is Safari on iOS 6 caching $.ajax results?I have a hybrid application usingPhoneGapthat runs fine on Android and iOS. But when I started testing in iOS 6 I noticed that I am not getting server data for most of my ajax calls - instead I was getting the cached data from previous ajax calls.So far I have tried the following options to disable cache -Include a timestamp as query string parameter$.ajaxSetup({ cache: false });Inside the ajax callno-cache = true$.ajaxPrefilter(function (options, originalOptions, jqXHR) { options.data = jQuery.param($.extend(originalOptions.data||{}, { timeStamp: new Date().getTime() })); });But none of these seems to be working. I am invoke Java action classes from my ajax calls - will it have something to do with the reason why the methods listed above are failing?
Prevent iOS 6 from Caching Ajax POST Requests [duplicate]
You can use this code in yourDOCUMENT_ROOT/.htaccessfile:RewriteEngine On RewriteBase /xampp/external/proj3 # external redirect from action URL to pretty one RewriteCond %{THE_REQUEST} /search(?:\.php)?\?query=([^\s&]+) [NC] RewriteRule ^ search/%1? [R=302,L,NE] # internal forward from pretty URL to actual URL RewriteRule ^search/([^/.]+)/?$ search.php?query=$1 [L,QSA,NC]
I want when search form submitted, the URL be like this :localhost/xampp/external/proj3/search/searchqueryInstead of this:localhost/xampp/external/proj3/tools/search/search.php?query=searchquery
Rewrite search page query URL with htaccess
It'll be messy and not very readable, so my recommendation is to put this bash script inside a file on the image if possible, then you can usekubectl exec -it -n {namespace} {pod} -- bash {path/to/script}Otherwise you could do something like this:kubectl exec -it -n {namespace} {pod} -- bash -c 'echo Check running on host $(hostname); if [ ! $(nc -z -w10 prod.example.com 5671 > /dev/null 2>&1) ]; then echo "Example.com Rabbitmq SSL Port 5671 is not reachable from this Location/Resource!!"; echo "Please Make Sure Example.com Rabbitmq SSL Port 5671 is allowed in Your Firewall settings in the outbound Request!!"; exit 1; else echo "Example.com Rabbitmq SSL Port 5671 is reachable from this Location/Resource!!";fi 'This gives output like this:Check running on host shell-pod Example.com Rabbitmq SSL Port 5671 is not reachable from this Location/Resource!! Please Make Sure Example.com Rabbitmq SSL Port 5671 is allowed in Your Firewall settings in the outbound Request!! command terminated with exit code 1
How to use the bash script's if-else condition with just one command in Kubernetes exec mode?Below is the sample bash script which works well trying to check a VM's connectivity to a remote serverif ! nc -z -w10 prod.example.com 5671 > /dev/null 2>&1; then echo "Example.com Rabbitmq SSL Port 5671 is not reachable from this Location/Resource!!" echo "Please Make Sure Example.com Rabbitmq SSL Port 5671 is allowed in Your Firewall settings in the outbound Request!!" exit 1 else echo "Example.com Rabbitmq SSL Port 5671 is reachable from this Location/Resource!!" fiSo how can we do this entire bash script stuff in just one Kubernetes exec command?
How to use bash script's if-else condition with just one command in kubernetes exec mode?
The earliest commit shown in the file's history was a refactoring, during which the file was moved. The commit you see in the blame output is from before the file moved. The history will have been generated using a command like git log -- /components/org.wso2.analytics.apim/pom.xml, which doesn't follow file moves. You can tell git (at the command line) to provide a history that does follow file moves by saying git log --follow -- /components/org.wso2.analytics.apim/pom.xml, which I've verified does show the ce1b69 commit. (As an aside, by default git log also presents a simplified history. I can't think of an obvious reason why this would omit a commit that shows up in blame, but if two branches both introduced the same range of lines I would suppose it could be possible. Adding --full-history to the log would remedy that, if ever you were to encounter it.)
Here is one problematic file I found. When the blame view is clicked this page is given, when I take a look in to the history of the same file, it does not contain all the commits as shown in the blame view for the same file. For example the commit ce1b694d4a06425f933dfee5e0966349fdb9581d which added the lines from 40 to 52 is not shown in the history of the same file. What is the reason for this? Thanks in advance
Why the commits shown in blame view is not in the history view of the same file in github
you can use thelast_over_timefunction as it is describedhere.last_over_time(range-vector): the most recent point value in specified interval.last_over_time(container_memory_usage_bytes[1h])I didn't findfirst_over_timefor Prometheus. Maybe there is another way to do it in Prometheus. Although, Grafana has thefirst_over_timeasit is shown here. And as @valyala said, if you install and configureVictoriaMetricsyou can use itas described here.
I am trying to get the first and last element in a range vector retunred by a query that is similar to this:container_memory_usage_bytes[1h]In the resultset I get a list of timestamps and memory values for each pod in the hour.3863654400 @1629726924.874 3863539712 @1629726955.72 3863900160 @1629726984.032 3863937024 @1629727016.102 3863515136 @1629727049.814 3863703552 @1629727077.533 3863506944 @1629727104.48 3863896064 @1629727128.676If I only want to know what the first index and the last index of this array is i-e, the first record in the hour and the last record in the hour for each pod, how would I structure the query ?
How to get the first and last element of a range vector in promql
AFAIK this cannot be done by using a .Net library. K8 is all about orchestration. SF on the other hand is both an orchestrator + rich programming /application model + state management. If you want to do something like reliable collection in K8 then you have to eitherA) built your own replication solution with leader election and all.B) use private etcd/cockroachdb etc. storeThis article is pretty good in terms of differences.https://learn.microsoft.com/en-us/archive/blogs/azuredev/service-fabric-and-kubernetes-comparison-part-1-distributed-systems-architecture#split-brain-and-other-stateful-disasters"Existing systems provide varying levels of support for microservices, the most prominent being Nirmata, Akka, Bluemix, Kubernetes, Mesos, and AWS Lambda [there’s a mixed bag!!]. SF is more powerful:it is the only data-ware orchestration system today for stateful microservices"
We are in the process of migrating our Service Fabric services to Kubernetes. Most of them were "stateless" services and were easy to migrate. However, we have one "stateful" service that uses SF's Reliable Collections pretty heavily.K8s has Statefulsets, but that's not really comparable to SF's reliable collections.Is there a .NET library or other solution to implement something similar to SF's Reliable Collections in K8s?
Migrate Service Fabric Reliable Collections to Kubernetes
/proc and /sys are special filesystems created and maintained by the kernel to provide interfaces into settings and events in the system. The uevent files are used to access information about the devices or send events.If a given subsystem implements functionality to expose information via that interface, you can cat the file:[root@home sys]# cat /sys/devices/system/cpu/cpu0/uevent DRIVER=processor MODALIAS=cpu:type:x86,ven0000fam0006mod003F:feature:,0000,0001,0002,0003,0004,0005,0006,0007,0008,0009,000B,000C,000D,000E,000F,0010,0011,0013,0017,0018,0019,001A,001B,001C,002B,0034,003A,003B,003D,0068,006F,0070,0072,0074,0075,0076,0079,0080,0081,0089,008C,008D,0091,0093,0094,0096,0097,0099,009A,009B,009C,009D,009E,009F,00C0,00C5,00E7,00EB,00EC,00F0,00F1,00F3,00F5,00F6,00F9,00FA,00FB,00FD,00FF,0120,0123,0125,0127,0128,0129,012A,012D,0140,0165,024A,025A,025B,025C,025D,025FBut if that subsystem doesn't expose that interface, you just get permission denied - even root can't call kernel code that's not there.
I haveAKScluster deployed(version1.19) on Azure, part of the deployment inkube-systemnamespace there are 2azure-cni-networkmonitorpods, when opening a bash in one of the pods using:kubectl exec -t -i -n kube-system azure-cni-networkmonitor-th6pv -- bashI've noticed that although I'm running as root in the container:uid=0(root) gid=0(root) groups=0(root)There are some files that I can't open for reading, read commands are resulting in permission denied error, for example:cat: /run/containerd/io.containerd.runtime.v1.linux/k8s.io/c3bd2dfc2ad242e1a706eb3f42be67710630d314cfeb4b96ec35f35869264830/rootfs/sys/module/zswap/uevent: Permission deniedFile stat:Access: (0200/--w-------) Uid: ( 0/ root) Gid: ( 0/ root)Linux distribution running on container:Common Base Linux DelridgeAlthough the file is non-readable, I shouldn't have a problem to read it as root right?Any idea why would this happen? I don't see there any SELinux enabled.
Permission denied while reading file as root in Azure AKS container
.htaccessfiles should not be used unless you don't have access to the apache config. e.g. shared hosting. Since VPS/Cloud servers are abundant these days at very low costs, there is almost no reason to get shared hosting..htaccessfiles are actually read on every request because it uses per directory context. So using them causes a slight performance hit. Even just havingAllowOverride Allin your config has the same effect even if you don't use the.htaccessfile.The misconception that .htaccess files are needed is because most software e.g.wordpressor other cmses tell you to add your code there. That was because most hosting was shared in years past and people didn't have access to the Apache config file unless you bought expensive VPS' or dedicated servers.I don't believe there is any tracking at all and probably isn't needed because it reads the.htaccessfile on every request regardless if a change was made or not. So that's why they are completely inefficient and shouldn't be used. Put your rules and directives in your virtual host file and you'll have a better server.You can readWhen not to use .htaccessfrom Apache.ShareFollowansweredMar 24, 2015 at 13:54Panama JackPanama Jack24.3k1111 gold badges6363 silver badges9595 bronze badges0Add a comment|
I'm wondering, how .htaccess files are implemented in Apache? Are they really reparsed in each subsequent request or cached somewhere and reparsed only when changed?How change tracking of these files is implemented? stat() for filechanges on each request or via inotify()?
How Apache handles .htaccess file changes? Are they reparsed on each request?
I use this code in.htaccessto remove.phpextension and redirect.phpextension pages to non.phpextension pages :<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(wp-admin)($|/) - [L] # You don't want to mess with WordPress RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule .* $0.php # browser requests PHP RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php RewriteRule ^/?(.*)\.php$ /$1 [L,R=301] # check to see if the request is for a PHP file: RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^/?(.*)$ /$1.php [L] </IfModule>When the above code is used in.htaccess, you can accessPHPpages without the extension and when a user visits a page with.phpextension, he/she will be redirected to the page without the extension.Example :http://example.com/page.phpis redirected tohttp://example.com/pagehttp://example.com/pagewill be the same ashttp://example.com/page.phpThere wouldn't be any problem when you access PHP files with extension internally :<? include("page.php"); ?>will work without any problem.
I am rewriting my url to get rid of the.phpextension (and hopefully the get variables too as all the help I have gotten is great, but still wont work.Here is my code:Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / ## hide .php extension # To externally redirect /dir/foo.php to /dir/foo RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php[\s?] [NC] RewriteRule ^ %1 [R=301,L] # To internally forward /dir/foo to /dir/foo.php RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+?)/?$ $1.php [NC,L]Now when I use this code, it takes the .php out, but then the error says:Not Found The requested URL /index.php was not found on this server.Meanwhile, if I take that code out, it works fine, but has the.phpextension
Removing URL .php extension gives 404 error
Bower currently looks for tarballs associated with git tags on github. Logic is here:https://github.com/bower/bower/blob/master/lib/core/resolvers/GitHubResolver.js@apatrick is correct, currently best practice is to either have a/distfolder or have a separate shim repo like this:https://github.com/angular/bower-angularUsing github releases isn't such a bad idea in my opinion. It's been discussed before. Reason for not implementing is here:https://github.com/bower/bower/issues/584#issuecomment-20456122If you feel strongly about it, please ask the contributors to repon the ticket.
As far as I understandBoweryou have to provide a pre-build distribution of your package:Bower works by fetching and installing packages from all over, taking care of hunting, finding, downloading, and saving the stuff you’re looking for.But in many projects such pre-build files are not part of the GitHub repository (for very good reasons). Regarding to thispostyour are able to attach archives to an release/tag of an GitHub repository. So the best way to register such projects as a Bower package seems to be to use these attachments; instead of a separate repository like suggestedhere. But itseemsthis is currently not possible. Am I right?
Register bower package with GitHub release attachments
Just heard from GitHub support that this is not currently supported. I have passed it as a feedback as nice to have.
Overview:I have created a Project under a GitHub repository and added some custom columnsReady,In ProgressandDoneGoal:I would like to move the issue fromReadytoIn Progresswhen a branch is created for that issue.Example: If I have an issue #10 inReadyand I create a branch from master called#10-FixBugthen I would like issue #10 to move fromReadytoIn Progress.Questions:How would I be able to do this ?I don't see any built in automation preset for this, can I customise the project automation to achieve this goal ?Do I need to create a web hook ? (I was under the impression web hook is mainly for 3rd party tools.) If so how should I configure for GitHub to pick the event changes (is there a link?)Note:I am only using GitHub to manage my project, I am not using 3rd party tools such as Jira / Waffle or others
Project - Move issue from one column to another
4 Yes, both implement the OCI Image Spec. If your image is accessible to your containerd installation, it should work seamless. One example of running the redis:alpine image from Docker Hub: ctr image pull docker.io/library/redis:alpine ctr run docker.io/library/redis:alpine myid Share Improve this answer Follow answered Aug 19, 2020 at 1:23 Gustavo KawamotoGustavo Kawamoto 2,8201818 silver badges2828 bronze badges 3 1 I want to use my local images that I've already pulled with docker or I build it locally , is there a way to do that ? – Saida Meftah Aug 19, 2020 at 9:11 1 You can save the image from docker using docker save [your image] > image.tar and then import it into ctr using ctr image import image.tar. – Gustavo Kawamoto Aug 19, 2020 at 11:35 okay, that solved the inexsitant issue of mine, thank you ! – Saida Meftah Aug 20, 2020 at 18:17 Add a comment  | 
I used to work with docker images and now I am trying to run containers using containerd runtime. So, I want to share my prebuilt docker images with ctr, Is that possible ? How can I do that please ?
How can I share my docker images with Conatinerd runtime?
An Amazon CloudWatch custom metric is only created when data is stored against the custom metric. Therefore, you'll need to push a data value to make appear and then you will be able to create an alarm.You can push some data to CloudWatch with theAWS Command-Line Interface (CLI), eg:aws cloudwatch put-metric-data --namespace MongoDB --metric-name errors --value 0ShareFollowansweredJul 7, 2017 at 0:18John RotensteinJohn Rotenstein254k2626 gold badges408408 silver badges497497 bronze badges11Thanks, that worked. Although to be fair, thevaluehas to be "1" and the Metric will still not show on the Alarm Create screen. But I managed to create the Alarm anyway.–Christian DecheryJul 10, 2017 at 19:49Add a comment|
I had already created 7 other metrics based on some log files I send to CloudWatch with no problems.Some time ago we had a problem with MongoDB connection, and I identified that through logs, so I'd like to create a Metric, so that I can create an Alarm based on it. I did create the Metric, but (of course) there are no data being fed into that Metic, because no more "MongoError" messages exists.But does that also mean that I can't even access the Metric to create the Alarm? Because this is what is happening right now. The Metric cannot be seen anywhere, only in the "Filters" section of the Logs, which won't allow me to create Alarms or create graphics or anything.I have already posted this on AWS forums but that usually doesn't help.
CloudWatch custom metrics not working as expected
When you say mutableData doesn't seem to be deallocated, do you mean at the point of CGContextRelease(), or do you mean it never deallocates and it leaks every time you run this? In your first example, you would not expect mutableData to deallocate until the autorelease pool drains (generally at the end of the event loop), because you used -dataWithLength:. In your second example, it's undefined whether mutableData would be released. The call to -mutableBytes might apply a retain and autorelease to ensure the pointer is valid for the rest of the event loop (this is pretty common with these kinds of methods), but the docs don't say, so your second example is undefined behavior if you use bitmapData later. Now if mutableData leaks, then you're likely over-retaining it somewhere else.
I've been using NSMutableData* mutableData = [NSMutableData dataWithLength: someLength]; void* bitmapData = [mutableData mutableBytes]; CGContextRef context = CGBitmapContextCreate(bitmapData,...); // ...use context CGContextRelease(context); I have an autorelease pool in place, but when looking at this in Instruments, mutableData doesn't seem to be deallocated. I thought of using alloc/init like below, but I'm not sure if sending release would purge bitmapData as well. NSMutableData* mutableData = [[NSMutableData alloc] initWithLength: someLength]; void* bitmapData = [mutableData mutableBytes]; [mutableData release]; //... What's the proper way of using NSMutableData here? I thought using NSMutableData instead of malloc() and mutableData0 would be convenient because it'll be autoreleased. but now I'm not sure if that's true.
Using the bytes of an NSMutableData instance while allowing it to be autoreleased
Solved. I used thesumfunction:An alert will fire if the sum is not equal 1.
I have a dashboard in Grafana that I will use to monitor a Kafka instance. I can get the metrics using Prometheus.The metric is calledactive controller countand It is very important to monitor Kafka.I got what I want using the metrickafka_controller_kafkacontroller_activecontrollercount_value{job="kubernetes-service-endpoints"}In any moment only one of the 3 metrics must be equal 1 and the other two must be equal 0.How can I make an alert that fires when the condition above is not satisfied?I tried the following but with no success:
Grafana alert for Kafka metric Active Controller Count
0 You can use mysqladmin to start/stop the replication like this: # mysqladmin -u root -p start-slave # mysqladmin -u root -p stop-slave Share Improve this answer Follow answered Jun 26, 2022 at 12:47 Bernd BuffenBernd Buffen 14.7k22 gold badges2424 silver badges4040 bronze badges 1 will it work from the mysql shell in python mode? – Jules Jun 26, 2022 at 16:42 Add a comment  | 
I am using MySQL 8.0.23 docker container to back up an instance using util.dump_instance() from a time delayed replica instance using MySQL shell in Python mode. How can I stop the replication before I run the instance dump? I could find no examples in the documentation. I would run the equivalent of the following statement: mysql -h"$MYSQL_HOST" -P"$MYSQL_PORT" -u$MYSQL_USER -p"$MYSQL_PASS" -e 'STOP SLAVE SQL_THREAD;' so starting the replication would be easier on the instance since the binary log will contain the entries to be replicated. Current code: import os import time TIME = time.strftime("%Y%m%d-%H%M") MYSQL_HOST = os.getenv('MYSQL_HOST') MYSQL_PORT = os.getenv('MYSQL_PORT') BACKUP_PATH = "/backup/"+MYSQL_HOST+":"+MYSQL_PORT+"//"+TIME util.dump_instance( BACKUP_PATH, {'dryRun': False, 'threads': 4, 'showProgress': True, 'consistent': True})
How do you stop MySQL replication using mysql shell 8.0.23?
Then try one of the PHP gitignore proposed bygitignore.ioIt mainly depends on the editor you are using.For instance:phpstorm+all.In the OP's case, forWordpress:# Created by https://www.gitignore.io/api/wordpress # Edit at https://www.gitignore.io/?templates=wordpress ### WordPress ### # ignore everything in the root except the "wp-content" directory. !wp-content/ # ignore everything in the "wp-content" directory, except: # "mu-plugins", "plugins", "themes" directory wp-content/* !wp-content/mu-plugins/ !wp-content/plugins/ !wp-content/themes/ # ignore these plugins wp-content/plugins/hello.php # ignore specific themes wp-content/themes/twenty*/ # ignore node dependency directories node_modules/ # ignore log files and databases *.log *.sql *.sqlite # End of https://www.gitignore.io/api/wordpress
Github.com and Github Desktop both asked the format of .gitignore I wanna use when creating a new repo. But PHP is not in the selection.So which should I select?
What .gitignore should I use for PHP in Github?
ithub Markdown's seems do not support title attribute.Yet,GFM specs mentions:A link contains link text (the visible text), a link destination (the URI that is the link destination), and optionally alink title.[link](/uri "title")Give:<p><a href="/uri" title="title">link</a></p>
I want to add a title attribute to a link, which will show up when the user holds the mouse pointer it. Title attributes are helpful if your link text is not descriptive enough to tell users where they're going. (In reference links, you can use optionally parentheses for the link title instead of quotation marks.)Github Markdown's seems do not support title attribute.
Does Github Markdown support title attribute?
Similar tothis answer, you can:test if afolder exist(File.directory?(directory))delete it, usingFileUtils.rmdir(disks_directory)(as used in thisVagrant script)ShareFollowansweredMar 4, 2022 at 8:30VonCVonC1.3m539539 gold badges4.6k4.6k silver badges5.4k5.4k bronze badgesAdd a comment|
I'm using vagrant to clone my git repository. I deleted my repository from GitHub my git account. now trying to clone a repository couldn't error message is destination path already exist. how do I delete this already existing path and start afresh?
vagrant-Git repository
So, I was actually able to achieve this by defining a new provider in the module which assumes theOrganizationAccountAccessRoleinside the newly created account.Here's an example:// Define new account resource "aws_organizations_account" "my_new_account" { name = "my_new_account" email = "[email protected]" } provider "aws" { /* other provider config */ assume_role { // Assume the organization access role role_arn = "arn:aws:iam::${aws_organizations_account.my_new_account.id}:role/OrganizationAccountAccessRole" } alias = "my_new_account" } resource "aws_config_config_rule" "s3_versioning" { // Tell resource to use the new provider provider = aws.my_new_account name = "my-config-rule" description = "Verify versioning is enabled on S3 Buckets." source { owner = "AWS" source_identifier = "S3_BUCKET_VERSIONING_ENABLED" } scope { compliance_resource_types = ["AWS::S3::Bucket"] } }However, it should be noted that defining the provider inside the module leads to a few quirks, notably once you source this moduleyou cannot delete this module. If you do it will throw aError: Provider configuration not presentsince you will have also removed the provider definition.But, if you don't plan on removing these accounts (or are okay with doing it manually when needed) then this should be good!
My goal is to create a Terraform Module which creates a Child AWS accountandcreates a set of resources inside the account (for example, AWS Config rules).The account is created with the followingaws_organizations_accountdefinition:resource "aws_organizations_account" "account" { name = "my_new_account" email = "[email protected]" }And an exampleaws_config_config_rulewould be something like:resource "aws_config_config_rule" "s3_versioning" { name = "my-config-rule" description = "Verify versioning is enabled on S3 Buckets." source { owner = "AWS" source_identifier = "S3_BUCKET_VERSIONING_ENABLED" } scope { compliance_resource_types = ["AWS::S3::Bucket"] } }However, doing this creates the AWS Config rule in the master account, not the newly created child account.How can I define the config rule to apply to the child account?
Terraform Create resource in Child AWS Account
First, set up the parent repo:Open your forked repo in SourceTree.SelectRepository➫Repository Settings…in the menu (or press⇧⌘,).In theRemotespane, pressAdd.Enter any name you like (oftenupstreamormaster) and the URL / path to the parent repo.Press OK, then OK.Now, to update:Select Pull in the toolbar.In the "Pull from repository" drop-down, switch from your fork to the repo you just added.Press OK.(Optional)Once you pull, you may want to push any new content up to the server.
I am using SourceTree (with BitBucket) to manage my code. I have forked a repo, and the parent repo has been updated.How do I use SourceTree to merge the upstream code into my forked repo?
How do I update my forked repo using SourceTree?
Just a quick answer to some of your question(for others, I will update later). Some questions can be found here. 1.1 Where are the snapshots stored? Share snapshots are stored in the same storage account as the file share. 1.2 Will it cost the storage capacity As per this doc (The Space usage section) metioned: Snapshots don't count toward your 5-TB share limit. There is no limit to how much space share snapshots occupy in total. Storage account limits still apply. This means that when you create a file share, there is a Quota option which let you specify the file max capacity(like 5 GB), if you total snapshots(like 10 GB) is larger than that max capacity, and don't worry, you can still save these snapshots, but the total snapshots capacity should less than your storage account's max capacity. If my snapshot exceeds 200, what will it be? Deleted by itself or the new one can't be created? if more than 200, an error will occur: "Exception calling "Snapshot" with "0" argument(s): "The remote server returned an error: (409) Conflict.". You can test it just using the following powershell code: $context = New-AzureStorageContext -StorageAccountName your_accouont_name -StorageAccountKey your_account_key $share = Get-AzureStorageShare -Context $context -Name s22 for($i=0;$i -le 201;$i++){ $share.snapshot(); start-sleep -Seconds 1 } May I delete the snapshot which I want by Azure Automation (use the runbook to schedules it)? This should be possible, I can test it at my side later then update to you. And most of the snapshot operation commands can be found here, including delete. update: $s = Get-AzureStorageShare -Context $context -SnapshotTime 2018-12-17T06:05:38.0000000Z -Name s33 $s.Delete() #delete the snapshot Note: For -SnapshotTime, you can pass the snapshot name to it. As of now, the snapshot name is always auto assigned a UTC time value, like 2018-12-17T06:05:38.0000000Z For -Name, pass the azure file share name
I have some questions about the Azure Files Share snapshot, if you know something about that, please let me know. Thanks. 1, Where are the snapshots stored? Will it cost the storage capacity and how about the cost of creates and delete snapshots? 2, If my snapshot exceeds 200, what will it be? Deleted by itself or the new one can't be created? 3, May I delete the snapshot which I want by Azure Automation (use the runbook to schedules it)? 4, If I use Azure automation and Back up (Preview) to deploy the Azure FileShare snapshot together, which snapshot will I get? If you know something about that, please share with us (even you can answer one of them, I will mark it as an answer). Thanks so much for your help.
Some question about the place to store and the cost of Files Share Snapshot
Fromthe HTML 4.01 specThe META elementhttp-equiv = name [CI]This attribute may be used in place of the name attribute.HTTP serversuse this attribute to gather information for HTTP response message headers.That was the idea. It was the job of the server to convert the meta elements into real HTTP headersbeforethey sent it over the wire.But that meant that servers had to parse every HTML document before they sent it, and so it practically never happened.Browsers picked up the pieces as best they could, but caching rules apply to proxies too, and those will only process real HTTP headers, so cache-control http-equiv meta elements are not valid in HTML5.You should always use real HTTP headers, which are either added by the server as part of its configuration, or in server-side code (i.e., code written in PHP, Java servlets, ASP.NET etc.)
This is an html metatag example:<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="private">It's set on the html metatag to enable caching.I tried it with Tomcat and Firebig. The server send the information in the html metatag. but there is no information about caching in the http header response.However something like this in an http header response is valid:Cache-Control: privateSo I was wondering: when the information is written in the http response?What's the need of having two way of setting the same information (metatag and http response line)?
What's the difference between setting cache control in the http header response or the html metatag?
The amount of time I spent on this is embarrassing, but I will share anyway in hopes of saving other people the hours of their lives that would otherwise be stolen by Amazon. To answer your question, yes, I did get my node/express application running. In case you were using any kind of process.env method of choosing your port number, change your listening port to 80 (or 443 if appropriate). Most importantly, Amazon doesn't care what your main file is. Rename it server.js and have it in the root directory of your application. That is the file that monit tries to run. Hopefully that helps. If it doesn't, or if all of that is obvious, I apologize for my silliness and blame lack of sleep. :)
As the title suggested, I've been playing around deploying apps with Amazons new OpsWorks management system, however I haven't been able to figure out how to get the node server to start running on the instance. From the ports the application layers have access too I assume I need be listening on port 80, however I feel that the problem is that the correct file isn't being started. Similar to a Procfile on Heroku, is there a special start-script type file that needs to be included for OpsWorks to start it properly? Note that I don't have experience with Chef yet, so I'm hoping to get it working with the default options, ie not writting a custom Chef recipe to do it.
Has anyone been successful deploying a node (express) app with Amazon OpsWorks?
I'd suggest caching already sent notifications. Before your application sends email, it can check if this error is already reported.And you can set the cache validity to, say 1 minute, so you get maximum 1 same email/minute. It is quite easy to implement in ASP.NET.ShareFollowansweredMay 14, 2012 at 5:54Bohumil JandaBohumil Janda37355 silver badges99 bronze badges1but still continues bogus url access will add load to server. how can we prevent that?–GopiMay 14, 2012 at 5:56Add a comment|
When a unavailable url is accessed, we internally raise an exception and email to support team. We do this to identify is there is hidden error in our web application. Couple of days back, suddenly there was a huge number of access to unavailable url which added load to server and casued SMTP to queue large exception emails. This attempt has brought IIS completely down and none of the applications are accessible.How to prevent this? Is there any other option like firewall etc to disallow continues request from same ip. I have seen this behavior in google. How can we achieve that?
Bogus URL access causing server to hang
Compile your code in release mode. This does two things. It turns on the optimizations which definitely help. Also the memory management libraries are different for debug and release. The debug version of the library are built to allow for debugging and they maintain extra information (like marking de-allocated memory). All this extra processing does actually cost The objective of the two version of the library are completely different. The release version is definitely optimized for speed the debug version is optimized for recovery and debugging. Note this information is about DevStudio.
I have a question for which I am unable to find answer on the net... I have a set declared like this: set<unsigned int> MySet I am inserting a million random numbers generated with mersenne twister. Random generation and insertion are really fast (around a second for a million numbers), but deallocation is extremely slow (1 and a half minute). Why is deallocation so slow? I am not using any custom destructors for the set.
Why is deallocation slow?
You have to turn seo urls on from your admin panel. Go to System>Settings>Edit>Server> check yes for use seo urls. and be sure that all your products and categories have the right seo-url data and replace any space by '-'.
I have installedopencartversion3.0.2in my localhost. everything works fine except seo friendly url. when i try to removeindex.php?route=...then i got404error. when i tried following code in my.htaccessfileRewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php/$0 [PT,L]then404error gone but products doesn't display. when i getback default.htaccessfile then seo friendly url shows404error. please help me. Thanks
how to remove index.php from opencart v 3.0.2
I ended up finding this out with the help of a coworker. It's a little bit harder than just a regular old postgres database, but not much. This is based off this stackoverflow answer. Generate your heroku database dump download url: heroku pgbackups:url Start a bash shell on your postgres container. On my system this container was named pg: fig run db bash Install curl: apt-get update && apt-get install curl Download the database dump using curl: curl -o latest.dump [PASTE THE OUTPUT OF STEP 1 HERE] Import the dump (note, database name and username can be found in fig.yml and database.yml respectively): pg_restore --verbose --clean --no-acl --no-owner -h [YOUR BOOT2DOCKER IP] -U [YOUR_USERNAME] -d [DATABASE_NAME] latest.dump And there you have it! If the last step fails with some kind of invalid database error, double check latest.dump with head latest.dump. If you feel like your database is not downloading correctly, you may want to manually download it via the web gui and upload it to another host, like drop box. Then you would substitute step 1 with whatever url your dump can be found at.
I'm running boot2docker on OSX 10.10. I have a database container set up so my databases don't get reset every time I start/stop a container. I would like to import a dump of a postgres database from heroku into my docker database. Is this possible to do?
Import a heroku postgres database dump into a docker database container with boot2docker
This is the policy that ended up working. When creating the buckets, they get a name such asstandard_prefix-20150101,standard_prefix-20150515, etc. Users with this IAM policy can then do whatever on those buckets, but not modify other buckets in the account.{ "Version": "2012-10-17", "Statement": [ { "Sid": "One", "Effect": "Allow", "Action": [ "*" ], "Resource": [ "arn:aws:s3:::standard_prefix-*" ] }, { "Sid": "Two", "Effect": "Allow", "Action": [ "s3:List*" ], "Resource": [ "arn:aws:s3:::*" ] } ] }
I am creating S3 buckets in a program using 'standard-prefix-{variable}'. In trying to create an IAM policy so a user can update, create, delete buckets in an account, but only if the bucket name contains the 'standard-prefix'. IE, I don't want to allow modifying other buckets in the account. I'm finding many ways to limit access to resources within a bucket, given a specific bucket name, but no way of limiting access when the bucket names are changing.Something like (which doesn't seem to be working):"Resource": "arn:aws:s3:::standard-prefix-*"Examples fromAWS Docs:Dynamic name based on username is the closest I've found. But I need a wildcard for the variable part of the bucket name:{ "Version": "2012-10-17", "Statement": [{ "Effect": "Allow", "Action": "sqs:*", "Resource": "arn:aws:sqs:us-west-2:*:${aws:username}-queue" }] }Items with in a specified bucket name:{ "Version": "2012-10-17", "Statement": [ { "Action": ["s3:ListBucket"], "Effect": "Allow", "Resource": ["arn:aws:s3:::mybucket"], "Condition": {"StringLike": {"s3:prefix": ["${aws:username}/*"]}} }, { "Action": [ "s3:GetObject", "s3:PutObject" ], "Effect": "Allow", "Resource": ["arn:aws:s3:::mybucket/${aws:username}/*"] } ] }
Variable resource name in AWS IAM policy
What you are looking for is something that can report back the status from the PipelineRun to GitHub.This can be done in a few different ways. One way to do it is by using thecommit--status-tracker, however it seem to use the "older" concept withPipelineResources, so I would recommend to use e.g.GitHub App Notifierinstead, although it seem to be pretty new.
I'm looking for a way, if existing, of linking Tekton tasks running in Kubernetes cluster to GitHub steps, so that I can mark required steps in GitHub and allow PR merge only if they are passing.I know about Tekton triggers, which solve the other part of the problem, i.e. reacting to events in GitHub, such as the creation of a new pull request, or a merge on master branch. But would Tekton be able to call the GitHub API in the way I expect?
Tekton - Github integration
I am not completely clear on the exact problem but another solution would be to have a Cache with softValues() instead of a maximum size or expiry time. Every time you access the cache value (in your example, start the computation), you should maintain state somewhere else with a strong reference to this value. This will prevent the value from being GCed. Whenever the use of this value drops to zero (in your example, the computation ends and its OK for the value to go away), you could remove all strong references. For example, you could use the AtomicLongMap with the Cache value as the AtomicLongMap key and periodically call removeAllZeros() on the map. Note that, as the Javadoc states, the use of softValues() does come with tradeoffs.
I've got a Guava Cache (or rather, I am migrating from MapMaker to Cache) and the values represent long-running jobs. I'd like to add expireAfterAccess behavior to the cache, as it's the best way to clean it up; however, the job may still be running even though it hasn't been accessed via the cache in some time, and in that case I need to prevent it from being removed from the cache. I have three questions: Is it safe to reinsert the cache entry that's being removed during the RemovalListener callback? If so, is it threadsafe, such that there's no possible way the CacheLoader could produce a second value for that key while the RemovalListener callback is still happening in another thread? Is there a better way to achieve what I want? This isn't strictly/only a "cache" - it's critical that one and only one value is used for each key - but I also want to cache the entry for some time after the job it represents is complete. I was using MapMaker before and the behaviors I need are now deprecated in that class. Regularly pinging the map while the jobs are running is inelegant, and in my case, infeasible. Perhaps the right solution is to have two maps, one without eviction, and one with, and migrate them across as they complete. I'll make a feature request too - this would solve the problem: allow individual entries to be locked to prevent eviction (and then subsequently unlocked). [Edit to add some details]: The keys in this map refer to data files. The values are either a running write job, a completed write job, or - if no job is running - a read-only, produced-on-lookup object with information read from the file. It's important that there is exactly zero or one entry for each file. I could use separate maps for the two things, but there would have to be coordination on a per-key basis to make sure only one or the other is in existence at one time. Using a single map makes it simpler, in terms of getting the concurrency correct.
Is it safe to reinsert the entry from Guava RemovalListener?
CloudKitCloudKit provides authentication, a private and a public database, and structured asset storage services. CloudKit is a framework that allows an app to connect to iCloud APIs.iCloud DriveiCloud Drive is Apple's online storage service — a place to keep user files and access them from Apple devices, such as an iPhone, iPad, or Mac.In summary,iCloud Driveis where apps can store user’s data and files for access from other devices.CloudKitis the framework that makes it possible to accessiCloud/iCloud Drive.↳https://developer.apple.com/icloud/
What is the difference between iCloud Drive and CloudKit? Which would be better for storing manual, periodic app document backups? I did see this question:iCloud versus iCloud Drive versus CloudKitbut it is about costs and not the differences between the actual services.
What is the difference between iCloud Drive and CloudKit?
Answer your self with the question following. So splitting backend, microservices and UI app, android app, ios app(even when they are different parts) is not very sensible, due to the high dependency on each other if your answer is yes to below questions. Are the multiple parts developed by the same team? Have the same release cycle? Is each project partially dependent on the other to release or revert? Opt for multiple repositories when you say yes to the following? A single repository would be too large to be efficient.? Your repositories are loosely coupled, or decoupled.? A developer typically only needs one, or a small subset of your repositories to develop.? Different teams work on different repositories. There are many more question to ask yourself still. There is no predefinded pattern for individual cases.
I have a project which I would like to store on GitHub. This project contains code to run on an Arduino, Android, iOS as well as server code. Each section of the code interacts with the other, however, development of each section is more or less independent. Should I have all the code sections in one repository under different orphan branches, or should I have a separate repository for each section? Why? What would be the advantages and inconveniences of each method? Thank you very much!
Multiple orphan branches or separate repositories - git
If your Jenkins has permission to build/run a Java or Python (or Go) program, it can launch a Beam pipeline.ShareFollowansweredFeb 14, 2022 at 19:39robertwbrobertwb4,9861919 silver badges2121 bronze badgesAdd a comment|
I’ve searched google and stack for this solution in pieces and can’t seem to get a foot hold. My main cloud of unknowing is if Apache beam has the ability to ingest a TFX pipeline config file via git/Jenkins and can kickoff via api or cli the pipeline. For some reason I can’t find clear documentation on it. If anyone has documentation that would be great! I’ll continue my search as well. I’m hoping someone has done this before as I am stuck with Jenkins for deployment.
How to deploy Tensorflow TFX pipeline with Git/Jenkins Orchestrating in Apache beam
To clarify ... I want to make a backup of all directories, for example to /home/user file is named backup-2014.02.02.tar and is located in the directory /home/user /backups. I'm doing a backup of the entire /home directory with the following script: #!/bin/bash today=$(date '+%Y.%m.%d') tar czf /var/backup/backup_"$today".tar.gz /home Yes, but I want to go to backups in the following way ... If the directory was /home/user file batskup-user-2014.02.04.tar.gz to go to the directory /home/backups
I want to make a backup of each directory in /home separately and each directory tar (backup) files to enter into a specified directory. Under linux ubuntu.
Backup directories in home with tar
If in bash, try git ls-files --recurse-submodules -- **/IJob.java. If it does not work, run shopt globstar to see if globstar is on or off. If it's off, run shopt -s globstar to turn it on and then the command should work. find . -name 'IJob.java' should also work.
i am trying to find the path of a file given its filename. i tried the command git ls-files --recurse-submodules -- IJob.java where IJob.java is the filename.However the command returns empty. [hema@localhost org.eclipse.jdt.core]$ git ls-files --recurse-submodules -- IJob.java [hema@localhost org.eclipse.jdt.core]$ but the file gets listed when i simply type ls-files. [hema@localhost org.eclipse.jdt.core]$ git ls-files ....... ....... org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/VariableLocator.java org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/matching/VariablePattern.java org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/IJob.java org.eclipse.jdt.core/search/org/eclipse/jdt/internal/core/search/processing/JobManager.java pom.xml tests-pom/pom.xml why doesnt the command list the complete path of the file.what must i include
git ls-files returns empty
-eqexpects 2 integers for comparison (seeman test). You should use=there for strings.Or, could you be more tolerant about output from the script?if $SERVICE status | grep -q "not running"; then $SERVICE start fiOf course it would be much better to use a process monitoring tool likemonitorsupervisor.
I am using a shell script to start tomcat server if it is not running. I am running this script in cronjob to check it frequently. This is my script#! /bin/sh SERVICE=/etc/init.d/tomcat7 STOPPED_MESSAGE="Tomcat Servlet Engine is not running." if [ "`$SERVICE status`" -eq "$STOPPED_MESSAGE" ]; then $SERVICE start fiBut whenever I run this script, it gives me an error. If tomcat is not running then the error is :[: ILLEGAL NUMBER : * Tomcat Servlet Engine is not running.]And if tomcat is running the error is :[: ILLEGAL NUMBER : * Tomcat Servlet Engine is running with pid 6130.]I think the error is related to $SERVICE status but I am unable to resolve it. I am a new bee to shell scripting. Please help me out.I cannot move forward until I resolve this issue.
shell script to automatically restart tomcat if stopped
If I do not set the field to null, that object may be sent to the second generation and will wait more.If you don't have a finalizerat allthen your object will be eligible for garbage collection earlier, and its fields won't be counted as GC roots, so the other objects may be eligible for garbage collection at the same time.Even if youdoneed a finalizer, unless that finalizer resurrects the object, the finalized object will still be eligible for garbage collection, so its fields won't keep the other objects alive.It's veryveryrarely a good idea to write a finalizer in Java... and if it's just going to set fields to null, that's definitely a bad idea. (It will almost certainlyhurtperformance rather than help it.)
When you do something like below,@Override protected void finalize() throws Throwable { //////////////////////// this.aVeryBigComponent = null; //////////////////////// super.finalize(); }Sonar complains aboutBad practice - Finalizer only nulls fieldsfindbugs : FI_FINALIZER_ONLY_NULLS_FIELDSThis finalizer does nothing except null out fields. This is completely pointless, and requires that the object be garbage collected, finalized, and then garbage collected again. You should just remove the finalize method.As long as I know setting a field to null helps garbage collector destroy an object in the first run/generation. If I do not set the field to null, that object may be sent to the second generation and will wait more.What do you think?
What do you think about Sonar's Bad practice - Finalizer only nulls fields?
Easiest solution probably would be to set up an Alert with CloudWatch. Have a read at the documentation, which basically describes your use case perfectly: You can create an alarm that stops an Amazon EC2 instance when a certain threshold has been met A condition could be the average CPU utilisation, e.g. CPU utilisation is below a certain point (which most probably correlates with no logged in users / no developer actually utilising the machine).
Can we stop an AWS windows server EC2 instance of a development environment when there is no activity in it, say after 2 hours of inactivity? I am having trouble identifying whether any user is connected to the server virtually. I can easily start/stop the EC2 at a fixed time, programmatically, but in order to cut the cost of my server, I am trying to stop the EC2 when it is not being used. My intent(or use case) is: If no user is using the EC2 till a specified amount of time, it will automatically stop. Developers can restart it as and when needed.
Programmatically Stop AWS EC2 in case of inactivity
I'd consider usingcron-parser, this allows you to determine previous and future cron times from a cron expression.For example:const parser = require('cron-parser'); const options = { currentDate: new Date('2020-06-25T13:02:00Z'), iterator: true }; const interval = parser.parseExpression('0 */5 * * * *', options); console.log("Previous run:", interval.prev().value.toISOString()); console.log("Next run:", interval.next().value.toISOString());You should see something like:Previous run: 2020-06-25T13:00:00.000Z Next run: 2020-06-25T13:05:00.000Z
I would like to be able to find the times a cron job would have ran given the cron string. For example, with0 */5 * * * *, the job runs every five minutes. If it is 13:02, the next job is at 13:05 and the last job was at 13:00. If there is a library out there that does this, I would like to use that if possible.
How do you calculate past cron jobs schedules?
For example, if you have two metrics from different exporters:probe_success => Blackbox exporter node_memory_MemTotal_bytes => Node exporterSuppose they have two common labels: "instance" and "group".If you use the following query:sum by (instance, group) (node_memory_MemTotal_bytes)>20000000000 and sum by (instance, group) (probe_success)==1You'll get the instance+group with memory>20G and is UP.See more info about logical operators in Prometheus documentationhere.
I'm trying to monitor if a queue in rabbitmq:has messagesdoes not have a consumeris not called .*_retryIf a queue matches all three, I want to create an alert.The individual metrics are no problem to find but I cannot comprehend how I am going to AND the different metrics in one query, grouping them by a set of labels (ie. instance, queue).Is this even possible?I'm using the latest version of prometheus and scraping rabbitmq via it's built-in prometheus metrics plugin.
Prometheus query comparing different metrics with same set of labels
The Delphi IDE has several issues managing memory that were never really fixed by Embarcadero, one of the main issue is that the IDE and compiler have huge memory consumption due to caches that are not released between compilation runs. A workaround that I've applied with success with my codebase is to compile all the projects from the command line with a tool like ANT using the dcc compiler, this will save IDE memory consumption. In the case you need to debug applications then you can compile and build a project at time and restart the IDE every 2/3 compilation. Another workaround that I've applied successfully in Delphi XE7 to reduce IDE memory consumption was renaming the following IDE files : Borland.Studio.Delphi.dll Borland.Studio.Refactoring.dll refactoride210.bpl This makes the XE7 IDE usable again; just the refactoring feature aren’t available anymore. If the aforementioned solutions don't work for you you will have to split your project group in single projects and switch between project each time as someone else suggested commenting your question. The new Delphi 10 Seattle seems to address some of these memory related issues since they claim : “Under the hood” the IDE’s project, file, and build management handling has gone through a major overhaul and redesign to provide significantly extended available memory, giving developers a more stable, capable, and faster development experience. But honestly I don't think it is the definitive solution, is just an improvement of the situation. The final solution of this situation is a 64bit IDE that is not a simple thing to implement by them since I think they have to handle a legacy and not very flexible codebase ... Try the new Delphi 10 and see if the situation improve, if not apply the workaround and wait for a 64bit IDE release.
I use Embarcadero Delphi XE5 Enterprise Edition. I have a project group consisting of 17 projects. When I click 'Compile All' after 7th compiled project IDE throw me an exception: [Fatal Error] Exception of type 'System.OutOfMemoryException' was thrown. What is a reason of such error and how to handled with it?
"Exception of type 'System.OutOfMemoryException' was thrown" when compiling several projects at once
It indeed looks like a bug in the engine. What is interesting however is, that the underlying function works with a column parameter. So you can use this as a workaround.SELECT at_timezone(date_utc,x.timezone) FROM ( SELECT TIMESTAMP '2018-09-09 12:00:00' as date_utc, 'America/Chicago' as timezone ) x;ShareFollowansweredSep 21, 2018 at 15:21jens walterjens walter13.6k33 gold badges5757 silver badges5555 bronze badges1Thank you for your help! I was worried the question was going to be too niche to get responses and the aws forums themselves are a crap shoot–micahSep 21, 2018 at 15:23Add a comment|
Here is an operation you can perform in Athena-SELECT date_utc AT TIME ZONE 'America/Chicago' FROM ( SELECT TIMESTAMP '2018-09-09 12:00:00' as date_utc ) x;In other sql engines you can changeAmerica/Chicagoto a column-SELECT date_utc AT TIME ZONE x.timezone FROM ( SELECT TIMESTAMP '2018-09-09 12:00:00' as date_utc, 'America/Chicago' as timezone ) x;In Athena you get-line 1:30: no viable alternative at input 'time zone x'Should it be possible to usex.timezonein Athena? This seems like a bug.
Can you use a column for the timezone parameter of AT TIME ZONE in Presto / Athena?
CloudFormation gives you the following benefits:You get to version control your infrastructure. You have a full record of all changes made, and you can easily go back if something goes wrong. This alone makes it worth using.You have a full and complete documentation of your infrastructure. There is no need to remember who did what on the console when, and exactly how things fit together - it is all described right there in the stack templates.In case of disaster you can recreate your entire infrastructure with a single command, again without having to remember just exactly how things were set up.You can easily test changes to your infrastructure by deploying separate stacks, without touching production. Instead of having permanent test and staging environments you can create them automatically whenever you need to.Developers can work on their own, custom stacks while implementing changes, completely isolated from changes made by others, and from production.It really is very good, and it gives you both more control, and more freedom to experiment.
I'm trying to understand the real-world usefulness ofAWS CloudFormation. It seems to be a way of describing AWS infrastructure as aJSON file, but even then I'm struggling to understand what benefits that serves (besides potentially "recording" your infrastructure changes in VCS).Of what use does CloudFormation's JSON files serve? What benefits does it have over using the AWS web console and making changes manually?
AWS CloudFormation vs. Web Console?