w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML Categories
Elastic Beanstalk - auto scaling - grace-period
well - I have found the 'Auto Scaling group name'. If you install awscli(http://aws.amazon.com/cli/) and do: aws ec2 --region 'your-region' describe-instances you get a load of json that includes the Auto Scaling group name help to set up awscli(http://www.dowdandassociates.com/content/howto-install-aws-cli-security-credentials/)

Categories : Wordpress

Symfony2 Using Amazon Load Balancers and SSL: Error on isSecure() Check
You're right the X_FORWARDED_PROTO header is hardcoded into HttpFoundationRequest while - as far as i know - overriding the request class in symfony is currently not possible. There has been a discussion/RFC about this topic here and there is an open pull-request that solves this issue using a RequestFactory.

Categories : Symfony2

Elastic Beanstalk's Elastic Load Balancer name
Unfortunately the answer is no to the first 2. The last one, you are able to do it, but it more or less goes against the flow of Elastic beanstalk. You would need to create your own ELB with whatever name you like and then put it in front ot the instance that is created by beanstalk. You would need need to delete the ELB that beanstalk created so that it's not sitting there costing you money. I can't remember if beanstalk boots its environments via an AutoScaling group, but if it does, you'll need to associate that AutoScaling group with your new ELB. After creating and syncing all of that up, you need to point your CNAME to your new custom made ELB. That should work.

Categories : Amazon

center a container in an elastic background environment
You're just asking for horizontal centering, on a fixed-width container. This is easily done entirely in CSS. Simply set for your container (the element that wraps around your entire site): .container { width: 800px; margin: 0 auto; } The "auto" will automatically even out the left and right margins (with no margin on top and bottom.) [Edit: oops forgot a bit] As for the blocks of colour, you can achieve this with a background image on your element, that's 1px wide and however tall you need. Just set it to repeat-x. If your two sections have the possibility of having different heights, you can break it up, so that: One container is full-width, and has the background colour. An inner container will then be fixed-width with auto margins as above; Another container is full-wi

Categories : HTML

Symfony2 service container: Inject array of services parameter as an argument to another service using XML
So, you inject array of parameters no array of services. You can inject service by service via: <services> <service id="notifications_decorator" class="NotificationsDecorator"> <argument type="service" id="decorator1"/> <argument type="service" id="decorator2"/> <argument type="service" id="decorator3"/> </service> </services> Or (in my opinion better way) tag decorators services and inject them to notifications_decorator during compilation passes. UPDATE: Working with Tagged Services In your case you have to modify your services like this: <services> <service id="decorator1" class="FirstDecorator"> <tag name="acme_decorator" /> </service> <service id="decorator2"

Categories : Symfony2

aws elastic load balancer not distributing
You need to have the route53 domain direct traffic to the ELB. If you have example.com and are trying to route that to the load balancer you need to associate the apex with the load balancer. To do this, go to the route53 tab. Click your hosted zone and go to record sets. then create a new zone and click yes for alias You then need to associate the hosted zone with your ELB. Now to get the traffic to fail over correctly you need to be running both instances behind the load balancer (preferably in multiple availability zones) and the ELB will take care of the failover. To do this, go to the elb section of ec2. Click your load balancer and add instances to it.

Categories : Amazon

Keeping a Ruby Service running on Elastic Beanstalk
I decided not to use the "services" section of the EB config files, instead just using the "commands" .. I build a service monitor in ruby that monitors a given system process (in this case my service). The service itself is a script looping infinitely with delays based on long polling times to the queue service. A cron job runs the monitor every minute and if the service is down it is restarted.

Categories : Ruby

Popup windows on page load with specific period
Add this code on you homepage. Modify it to show the popup instead of the alert in the show modal. This example sets the cookie to expire everyday. Change it to 7 days or whatever value you want... <script type="text/javascript"> function setCookie(c_name, value, exdays) { var exdate = new Date(); exdate.setDate(exdate.getDate() + exdays); var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString()); document.cookie = c_name + "=" + c_value; } function getCookie(c_name) { var c_value = document.cookie; var c_start = c_value.indexOf(" " + c_name + "="); if (c_start == -1) { c_start = c_value.indexOf(c_name + "="); }

Categories : Javascript

Amazon Elastic Load Balancer (ELB) url not resolved by instance attached to it
This is normal, if I correctly understand your testing framework. The way that ELB is scaling, it starts out running on a very small machine, and as traffic increases, it's directed to even larger and larger machines. However, ELB is not configured to handle flash traffic, especially from a small number of hosts, as is the case with a load testing scenario. This is because the DNS record is changed whenever ELB scales, and it sometimes takes a while to propagate. Load testing frameworks sometimes cache the DNS lookup, making things even slower. The official ELB documentation (http://aws.amazon.com/articles/1636185810492479) states that traffic should not be increased by more than 50% every 5 minutes. I found that scaling takes even longer if you're looking to get over 150-200k RPM.

Categories : Wcf

Why am I getting a 502 bad gateway when sending a redirect from behind amazon elastic load balancer?
It turns out that ELB is very picky about what it considers a 'valid' response and will return 502 Bad Gateway if it isn't happy. I fixed it by making sure the response from my server had the following headers: eg. if I was listening at http://example.com I send back the following response: HTTP/1.1 301 Moved Permanently Content-Type: */*; charset="UTF-8" Location: https://example.com/ Content-Length: 0 This makes ELB happy and everything works. For interest, here's the code (Java, using Simpleframework): private static void startHttpsRedirector() throws IOException { org.simpleframework.http.core.Container container = new org.simpleframework.http.core.Container() { @Override public void handle(Request request, Response response) { Path path = reques

Categories : Http

What method(s) do I use to configure/update an Elastic Load Balancer via Java?
My bad. Forgot to execute the requests against the ELB variable. The code below creates the health check and assigns the instances associated with the ELB. Hope this helps the next person asking this question. ConfigureHealthCheckResult healthResult = myELB.configureHealthCheck(healthCheckReq); RegisterInstancesWithLoadBalancerResult registerResult = myELB.registerInstancesWithLoadBalancer(regInst);

Categories : Java

Secure a specific page by client IP behind AWS Elastic Load Balancer
The client IP is actually being passed via header (X-Forwarded-For). This header may include other load balancer IPs in addition to the client IP. If you can configure filtering based on headers, you should be able to do what you are attempting to do.

Categories : Asp Net

Update stored content everyday with Service(AlarmManager) or launch period deduction
If you are going to run your service once a day with an AlamManager it will more then performance/battery efficient. You can increase the performance further if the service doesnt have to be run at the exact moment every day by using RTC instead of RTC_WAKEUP. This way you app wont wake up the CPU, rather the task will be executed when the user uses the phone again.(if the alarm is late already). But still you dont have to worry so much if the service isnt being run multiple times a day..think of it as an alarm clock that wakes you up everyday by ringing, doesnt eat up your battery.

Categories : Android

Running nginx infront of a unicorn or gunicorn under Elastic Load Balancer
In a word: yes. Amazon's ELB service is wonderful, but it is solely a load balancer. Running nginx on your own server gives you a locus of control and a place to do rewrites, redirects, compression, header munging, caching, and more. Furthermore it allows you to serve static files in the fastest possible way, rather than using a slot on your more heavyweight appserver.

Categories : Nginx

how to configure Elastic Beanstalk to deploy code to an instance but not add it to the load balancer
For the most part, though not straight forward, you could provide a .config file in .ebextensions to run your script files. This example of speeding up a deploy shows running some scripts and moving data back and forth. Better yet, the author describes the sequence and deployment process. I'm just embarking on this type of container customization. I have read of others dropping files in the /opt/elasticbeanstalk/hooks/appdeploy/pre and /opt/elasticbeanstalk/hooks/appdeploy/post directories, much of which can be derived by reading the post linked above. Also note that you can include the content of a script in the yaml .config file such as this which I found yesterday: files: "/opt/elasticbeanstalk/hooks/appdeploy/post/99_restart_delayed_job.sh": mode: "000755" owner: root

Categories : Ruby On Rails

How the spring container starts and ways to load the spring container
The simplest solutions is to use a ContextLoaderListener: <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/applicationContext*.xml</param-value> </context-param> See http://static.springsource.org/spring/docs/4.0.x/spring-framework-reference/html/web-integration.html for details.

Categories : Java

How to simulate Amazon's 60 sec timeout on Elastic Load Balancer (ELB) on a local xAMP environment?
This timeout has to do with a request taking more than 60 seconds, without sending any data as a response. Long HTTP requests like this should really be avoided. Even browsers may give up if they dont receive any response within a timeout period. If you can't get rid of long HTTP requests and you need to simulate it. You can use an fcgi/php-fpm configuration of php and provide a timeout of 60 seconds for which the fcgi process will wait for PHP to respond.

Categories : Apache

remove initial period and text after final period in string
This regex does what you want: ^.+|.[^.]*$ Replace its matches with the empty string. In R: gsub("^\.+|\.[^.]*$", "", subject, perl=TRUE); Explanation: ^ # Anchor the match to the start of the string .+ # and match one or more dots | # OR . # Match a dot [^.]* # plus any characters except dots $ # anchored to the end of the string.

Categories : Regex

Amazon web service load balancer unable to balance the load equally
There could be a number of reasons for this. Its without doing more digging, its hard to know which one you are experiencing. Sticky sessions can result in instances traffic becoming unbalanced. Although this depends heavily on usage patterns and your application. Cached DNS resolution. Part of how the ELB works is to direct traffic round robin on a DNS level. If a large number of users are all using the same DNS system provided by an ISP, they might all get sent to the same zone. Couple this with sticky sessions and you will end up with a bunch of traffic that will never switch. Using Route 53 with ALIAS records may reduce this somewhat. If you can't get the ELB to balance your traffic better, you can set up something similar with vanish cache or other software load balancer. Not as c

Categories : Amazon

Pass the 'container' as an argument to service
The container is registered as the service called "service_container", so you must pass "service_container" and not just "container": <argument type="service" id="service_container" /> This is why currently Symfony doesn't understand what is the service "container" because there is no one registered with this name !

Categories : Symfony2

Load the JSON into the container
The Solution was simple. It was a cache problem. Just need to add $ajaxSetup({cache: false}); //in the call back function and $ajaxSetup({cache: true});

Categories : Javascript

Symfony 2 Controller as a Service: container not injected
This is not a bug. It works as expected. This workflow generally "protects" the Controller as a Service concept. This way You need to look at Controller as a regular Service. In regular Service You inject everything what You need - if You need the controller itself - inject it explicitly. To explain it more clearly, this "protection" I mentioned helps to avoid using service:method notation in one place and controller::method or bundle:controller:method in another. So if not this "protection" it would be difficult to state that particular Controller is described as a Service or not as this would depend on which notation will be called first in Container build-up.

Categories : Unit Testing

Highcharts width exceeds container div on first load
I had a similar issue with centering the highcharts graph it gave. It would center and size correctly for some resolutions but not all. When it didn't, I had the exact same symptoms you're describing here. I fixed it by attaching/overriding additional css to the highcharts default. so in a custom css file, adding .highcharts-container{ /** Rules it should follow **/ } should fix your issue. Assuming that your div "hg=graph" has nothing but highcharts.

Categories : Jquery

How to load xib into two Container Views within one view controller
In the storyboard, you can add two container views to the same view controller and connect them both with the same child view controller by right-click dragging and choosing embed. This created the segue like so: Click on the segue and give it an identifier. Then, add the prepareForSegue method to your parent view controller, and set some properties for the lap timers separately if you want. - (void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { if ([segueName isEqualToString: @"embedSegueToLapTimerOne"]) { LapCounterNibViewController * childViewController = (LapCounterNibViewController *) [segue destinationViewController]; [childViewController setFoo:bar1]; } if ([segueName isEqualToString: @"embedSegueToLapTimerTwo"]) { LapCounter

Categories : IOS

Scroll a container on initial load in an Angular app
The trick is to add some delay when you populate the data like this :) $timeout(function () { for (var i = 0; i < 20; i++) $scope.items.push({ value: i }) }, 10); Demo

Categories : Javascript

Scaling only with AWS EC2 with Elastic Load Balancing and Auto-Scaling
ELB will pass through TCP and HTTP, you just need to set the ports you want. Autoscaling will scale the servers based on a set of parameters. So yes - you can - provided that your server can handle multiple instances of itself.

Categories : Amazon

Sharing session attributes of a web service and a servlet within same Tomcat container
The fact that your class test.main.StoreCreds implements an interface com.data.credentials.manager.IFStoreCredentials doesn't change the fact that your object is still an instance of the concrete test.main.StoreCreds. And if the wabapp doesn't know about this concrete class, it can't use an object of this type, because it can't find the byte-code of the class of the object, which is obviously needed to use it. The concrete class must be shared by both applications. That said, shared sessions is not standard, and should be avoided. Consider making it a single application, or storing the data you want to share between apps in a shared database.

Categories : Java

Is it considered poor DI practice to include your app container within the constructor of a service?
In my opinion, passing in the container is not good design. You are essentially passing in a generic object construction factory, and so bypass the value inherent in being explicit about your dependencies. In practice you could just as well declare a static property for container on your Service class. If I need to construct objects dynamically, I usually pass in a factory instead of an explicit instance. Like, passing in an ILogFactory instead of just an instance of ILog. This makes it apparent from the code what things are constructed dynamically, at the cost of a few factories and constructor parameters. Another option, if you do not have a need to create multiple instances of the dependencies, but you know you will only need some of them, is to ensure that object construction is ligh

Categories : C#

cocoalibspotify SPPlaylistContainer Vs SPPlaylist - can i load the container only to get the flattenplaylists?
Playlists will take a long time to load, especially on the first login when there's no cache. Loading all of the playlists at once actually isn't recommended, because if the user has a lot of playlists you need to be careful about memory usage. The approach you're doing is the correct way to load all the playlists, though. It taking time is expected.

Categories : IOS

Click links to load the relevant image into a container
$(function () { $("a.click").click(function (event) { //hide panel in case it's already visible because of a previously loaded image $("#hiddenPanel").fadeOut(0); //disable default link click event so page does not change if link has a href event.preventDefault(); //set links src to the src of image in the hidden panel $("#hiddenPanel img").attr("src", $(this).attr("src")); $("#hiddenPanel").fadeIn(1000); }); $("#closeButton").click(function () { $("#hiddenPanel").fadeOut(1000); }); }); FIDDLE You may want to fade out image slowly instead of fadeOut(0) if it's visible, and load the new one after fade out is complete.

Categories : Jquery

Load UIViewController inside a Container View using StoryBoard
Create child, when creating root VC: -(void)awakeFromNib { [super awakeFromNib]; // Create news vc from storyboard UIStoryboard* storyboard = [UIStoryboard storyboardWithName:@"YourStoryboard" bundle:nil]; NewsViewController *news = [storyboard instantiateViewControllerWithIdentifier:@"News VC ID, you should set it in IB"]; // Add it as a child to root [self addChildViewController:news]; [news didMoveToParentViewController:self]; // Save it for future use self.news = news; } Add child's view when root's view is created: -(void)viewDidLoad { [super viewDidLoad]; self.news.view.frame = self.newsSection.bounds; [self.newsSection addSubview:self.news.view]; }

Categories : IOS

On link click load html page in container
Perhaps use ajax rather than load? JSFIDDLE: http://jsfiddle.net/neuroflux/yHVMA/ $('aside a').on('click', function() { var url = $(this).attr("href"); $.ajax({ url: url, type: 'jsonp', //for x-domain success: function(data) { console.log(data); $("section").html(data); }, error: function(err) { alert("bugger! " + data); } }); return false; });

Categories : Javascript

Docker: Error starting container: Unable to load the AUFS module
I ran apt-get purge lxc-docker and reinstalled it with curl http://get.docker.io | sudo sh. I got the following error, but the installation continued and finished. Ensuring basic dependencies are installed... Looking in /proc/filesystems to see if we have AUFS support... Ahem, it looks like the current kernel does not support AUFS. Let's see if we can load the AUFS module with modprobe... FATAL: Module aufs not found. Ahem, things didn't turn out as expected. When I run docker run ubuntu echo hello the result is hello, so it looks like everything is alright.

Categories : Ubuntu

Format input field to separate the first 4 digits with a period, and the next 2 digits with a period
you can use input boxes of required length ex: <input type="text" maxlength="4">.<input type="text" maxlength="2">.<input type="text" maxlength="4">

Categories : Javascript

Count within a time period, a group of a smaller time period
Yup, possible with a GROUP BY and a HAVING, using some UNIX_TIMESTAMP rounding (subtracting stamp % 300 from stamp) to group into blocks of 300 seconds (5 minutes). SELECT COUNT(*), MIN(stamp) FROM mytable WHERE stamp >= NOW() - INTERVAL 30 minute GROUP BY FROM_UNIXTIME( UNIX_TIMESTAMP(stamp) - MOD(UNIX_TIMESTAMP(stamp),300) ) HAVING COUNT(*) >= 4 This assumes that you mean clock blocks rather than rolling blocks, i.e. you want from 00:00:00 to 00:04:59 etc., rather than from 13:23:01 to 13:28:00. This causes some issues with the "30 minutes ago" rule, so you might want to think that one through a bit carefully. EDIT: Well seeing as you insisted on making it a rolling block... let's add some delicious awfully-performing joining. SELECT COUNT(*), rolling.s

Categories : Mysql

Cannot load daemon when creating java service
Looks like your Main class resides in the default package, but you specify example.Main as the main class, and there is no class with such name. Try to replace example.Main with just Main.

Categories : Java

OSGi/Equinox, Declarative Service and Lazy Load
Bundles in the RESOLVED state cannot provide services, and they will be ignored by Declarative Services. You should in general start all bundles during launch time, even if you want lazy loading behaviour. The key is to make the activation of the bundles cheap (or free!), and only pay for initialization of components when they are required. DS takes care of lazy activation by default already. There is nothing you need to enable or change for this to happen. Essentially DS publishes the service entry in the registry, but it does not actually instantiate your component (or even load its class) until some client tries to use the service. Furthermore, because DS does not load the class until required, OSGi does not even need to create a ClassLoader for the bundle, so long as your bundle does

Categories : Java

How to Load Test a Web Service From a Text File of URLs
That's a pretty trivial task for good load testing software, so I'm curious why you haven't had any success. You didn't mention what level of load you are trying to test - if you are looking for a very high level of concurrency, then that may rule out many of the tools. So: I'd start by researching some load testing tools that can handle the level of concurrency you need and are within your budget.

Categories : Misc

Linux service can't load library path in the /etc/ld.so.conf.d
Did you run ldconfig (as root) lately? There's a shared library cache that's updated by that program, and if you updated a file in /etc/ld.so.conf.d without running ldconfig, the cache data could be out of date.

Categories : Linux

how to connect to google play service and load leaderboard
Yes. Take a look at the BaseGameActivity source and see that it largely just wraps GameHelper. You can implement the calls to GameHelper yourself - in fact, you can probably copy some code directly from BaseGameActivity. I'm a bit confused, because it appears that your code is already using GameHelper. It looks like you are mixing GameHelper calls with BaseGameActivity calls. You cannot do this, and it will result in... errors like you are getting. The LogCat you see means that all of your clients are connected. The default call to GameHelper.setup() just requests the Games client. If you aren't using BaseGameActivity and want different clients, do: gameHelper = new GameHelper(this); gameHelper.setup(this, GameHelper.CLIENT_GAMES | GameHelper.CLIENT_PLUS); beginUserInitiatedSignIn() is

Categories : Android

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.