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
# NOTE: These steps assume the following: | |
# * The heroku toolbelt is installed: https://toolbelt.heroku.com/ | |
# * A postgres server is installed and running: http://www.enterprisedb.com/products-services-training/pgdownload#osx | |
# STEP 1: Login to herku: | |
heroku login | |
# provide credentials | |
# STEP 2: Create database backup | |
heroku pg:backups public-url b001 --app <the name of your heroku application> |
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
sp_configure 'show advanced options', 1 | |
reconfigure; | |
-- show advanced options | |
-- backup compression default -- always compress backups. | |
-- blocked process threshold (s) -- only capture blocking scenarios that block this threshold. | |
-- clr enabled -- allows CLR user-defined stored procedures and functions. | |
-- Database Mail XPs | |
-- fill factor (%) -- useful for reducing fragmentation (for frequently updated tables). Reduces page-splitting when a record has be inserted in the middle of the page | |
-- max degree of parallelism -- set the max number of CPUs that are available for a single query. Can be overridden by MAX DOP setting on a query | |
-- remote access -- grant/revoke ability to allow remote users to access the SQL Server from external connections |
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
SELECT | |
OBJECT_NAME(f.parent_object_id) TableName, | |
COL_NAME(fc.parent_object_id,fc.parent_column_id) ColName | |
FROM | |
sys.foreign_keys AS f | |
INNER JOIN | |
sys.foreign_key_columns AS fc | |
ON f.OBJECT_ID = fc.constraint_object_id | |
INNER JOIN | |
sys.tables t |
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
[program:your_program_name_here] | |
command=;command to start your program | |
user=;user that your program should run as | |
autostart=true | |
autorestart=true | |
startsecs=10 | |
startretries=3 | |
stdout_logfile=;path to log file, e.g. /var/log/your_program_name_here-stdout.log | |
stdout_logfile_maxbytes=128MB | |
stdout_logfile_backups=32 |
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
SELECT OBJECT_NAME(object_id) as table_name, name, type_desc, is_primary_key, fill_factor FROM sys.indexes; | |
USE [whatever database] | |
GO | |
ALTER INDEX PK_GeoRoot ON GeoRoot | |
REBUILD WITH (FILLFACTOR = 80); |
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
/* Check existing indexes */ | |
SELECT | |
@@SERVERNAME AS [ServerName] | |
, DB_NAME() AS [DatabaseName] | |
, [SchemaName] | |
, [ObjectName] | |
, [ObjectType] | |
, [IndexID] | |
, [IndexName] | |
, [IndexType] |
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
Thumbs.db | |
*.obj | |
*.exe | |
*.pdb | |
*.user | |
*.aps | |
*.pch | |
*.vspscc | |
*_i.c | |
*_p.c |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Web; | |
namespace System.Web.Mvc.Html | |
{ | |
public class ImageSelectListItem : SelectListItem | |
{ | |
public string ImageFileName { get; set; } |
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
internal static string ListItemToOption(ImageSelectListItem item, string imagePath = "") | |
{ | |
//if (!(item is ImageSelectListItem)) | |
//{ | |
// throw new InvalidCastException(string.Format("Cannot cast {0} to System.Web.Mvc.Html.ImageImageSelectListItem.", item.GetType())); | |
//} | |
//ImageSelectListItem imageImageSelectListItem = item as ImageSelectListItem; | |
TagBuilder builder = new TagBuilder("option") |
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
/* Run this query against any database on a SQL Server instance to get version details*/ | |
SELECT | |
SERVERPROPERTY('productversion') AS ProductVersion, | |
SERVERPROPERTY('productlevel') AS ProductLevel, | |
SERVERPROPERTY('edition') AS Edition, | |
@@VERSION AS VerboseVersion; |