This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This script will: | |
- Depends on gist: https://gist.github.com/johnbabb/e385e10ea9dd06ddc3ea3160e7403dab | |
- This script provides the install script, create user script, mount user sftp drives script, | |
and sshd_confg file. | |
- create user script, mount user sftp drives script are copied to /usr/local/bin | |
- these scripts are used to add sftp users and mount their drives in /home/<user>/<downloads|uploads> | |
- sshd_confg is copied over to /etc/ssh/sshd_config | |
- Creates a virtual network |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void Main() | |
{ | |
int? page = 3; | |
int? pageSize = 25; | |
if (page.HasValue && pageSize.HasValue) | |
{ | |
var skip = (page.Value - 1) * pageSize.Value; | |
var take = pageSize.Value; | |
skip = skip < 0 ? 0 : skip; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To Export the Application Pools on IIS 7 : | |
%windir%\system32\inetsrv\appcmd list apppool /config /xml > c:\apppools.xml | |
To import the Application Pools: | |
%windir%\system32\inetsrv\appcmd add apppool /in < c:\apppools.xml | |
To Export all you’re website: | |
%windir%\system32\inetsrv\appcmd list site /config /xml > c:\sites.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# Carries out a full mysqldump, calls percona-xtrabackup and then | |
# copies the sql dump, the percona backup and your mysql bin logs | |
# to S3 using s3cmd http://s3tools.org/s3cmd | |
# | |
# TODO: extract out the S3 backup stuff to make it optional, and so | |
# other s3 programs can replace the s3cmd call. | |
# TODO: the if [ $? == 0 ] alert blocks should be a function | |
# TODO: make the if [ $? == 0 ] if [ $? != 0 ] more consistent - test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string baseUrl = "http://localhost"; | |
void Main() | |
{ | |
var urls = new string[] { | |
"/url/endpoint", | |
}; | |
var concurrentRequests = new int[]{ 1, 5, 25, 50, 100, 500, 1000}; | |
var numberOfTurns = 10; | |
RunTests(urls, concurrentRequests, numberOfTurns); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void SaveConfig(string key, string value) | |
{ | |
var config = ConfigurationManager.OpenExeConfiguration(Path.Combine(AssemblyDirectory, Assembly.GetExecutingAssembly().ManifestModule.Name)); | |
var applicationSectionGroup = config.GetSectionGroup("applicationSettings"); | |
var applicationConfigSection = applicationSectionGroup.Sections["AsyncLogging.Properties.Settings"]; | |
var clientSection = (ClientSettingsSection)applicationConfigSection; | |
var applicationSetting = clientSection.Settings.Get(key); | |
applicationSetting.Value.ValueXml.InnerText = value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CustomAssemblyResolver : DefaultAssembliesResolver | |
{ | |
private Assembly[] plugins = ( | |
from file in Directory.GetFiles( | |
AssemblyDirectory, "*.dll", | |
SearchOption.AllDirectories) | |
let assembly = Assembly.LoadFile(file) | |
select assembly) | |
.ToArray(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var JsonNetDecycle = (function () { | |
function JsonNetDecycle() { } | |
JsonNetDecycle.decycle = function decycle(obj) { | |
var catalog = []; | |
var newObj = JsonNetDecycle.getDecycledCopy(obj, catalog); | |
return newObj; | |
} | |
JsonNetDecycle.getDecycledCopy = function getDecycledCopy(obj, catalog) { | |
var i; | |
var name; |