Skip to content

Instantly share code, notes, and snippets.

View samfromlv's full-sized avatar

Alexander Shakhov samfromlv

  • Vesama
  • Riga, Latvia
View GitHub Profile
@samfromlv
samfromlv / autoscaleprofiles.json
Created November 26, 2019 09:01
Azure autoscale settings
{
"location": "West Europe",
"tags": {},
"properties": {
"name": "---removed---",
"enabled": true,
"targetResourceUri": "---removed---",
"profiles": [
{
"name": "Night time",
@samfromlv
samfromlv / Global.asax
Last active January 4, 2017 14:24
How to prevent WrongClassException in N2CMS
using N2.Engine;
using N2.Persistence;
using N2.Web.Mvc;
using System.Linq;
namespace Test
{
public class MvcApplication : HttpApplication
{
protected void Application_Start()
@samfromlv
samfromlv / AzureAutoscalingCheck.txt
Last active March 3, 2016 08:10
Simple application to illustrate how Azure built-in auto-scaling works and test result for scale-up and scale-down.
Application polls Azure cloud service and logs what instance responds to requests.
During auto scaling events instances can be added or removed from load balancer
and application is intended to capture this behavior.
On every keypress application will log NOTE in file and later you can replace these note with some text
or screenshots of Azure portal. To exit application and save log file press X.
Program.cs - console application to poll cloud service and capture statistics about instance responses.
WebApiController.cs - simple ASP.NET MVC controller to return instance name as response.
<?php
/*
Author: Jim Westergren & Jeedo Aquino
File: index-with-redis.php
Updated: 2013-03-02
Updated by: Alexander Shakhov
This is a redis caching system for wordpress.
see more here: www.jimwestergren.com/wordpress-with-redis-as-a-frontend-cache/