Skip to content

Instantly share code, notes, and snippets.

@teradyne
teradyne / private_fork.md
Created November 21, 2023 23:14 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@teradyne
teradyne / es.sh
Created March 29, 2014 18:27 — forked from rajraj/es.sh
cd ~
sudo yum update
sudo yum install java-1.7.0-openjdk.i686 -y
wget https://github.com/downloads/elasticsearch/elasticsearch/elasticsearch-0.19.9.tar.gz -O elasticsearch.tar.gz
tar -xf elasticsearch.tar.gz
rm elasticsearch.tar.gz
mv elasticsearch-* elasticsearch
sudo mv elasticsearch /usr/local/share
@teradyne
teradyne / RazorEngine_Example_Template.cs
Created May 14, 2012 23:34
RazorEngine Example Template
//using the RazorEngine @http://razorengine.codeplex.com/
// I am using this with ASP.NET forms (.NET 4.0) for email templates
// 1. Email HTML Templates Location:
// ~/templates/email/MyEmailTemplate.cshtml (name something useful like Page, Master where email is being sent)
//Helper methods - put this shit in a common helper class like below:
using RazorEngine;
@teradyne
teradyne / tools_net_web_development.txt
Created January 31, 2012 18:55
Tools for .NET and Web Development
Tools to use for .NET and Web development:
- Resharper
http://confluence.jetbrains.net/display/ReSharper/ReSharper+6.1.1+Nightly+Builds
- Reflector
http://www.reflector.net/
- Linqpad
http://www.linqpad.net/
- Autocode (add-in for Visual Studio 2010)
http://www.devprojects.net/
@teradyne
teradyne / sql_backup_mssql_db.sql
Created January 31, 2012 18:45
SQL Script to backup database to a file path
//SQL Script to backup database to a path using Query Analyzer
declare @dbname varchar(50)
declare @filestamp varchar(20);
declare @backuppath varchar(50);
declare @filepath varchar(200);
set @backuppath = 'C:\backups\data\full\mylivedb\';
set @filestamp = replace(replace(convert(varchar, getdate(), 120), ' ', '_'), ':', '');
set @filepath = @path + @filestampname + '.bak';
@teradyne
teradyne / linqpad_pluralsight.cs
Created January 31, 2012 18:37
Linqpad script : Get all Titles in all Courses from Pluralsight OData feed
//Linqpad script : Get all all Titles in all Courses
//Language: C# Expression
//Database: http://www.pluralsight-training.net/Odata/ (Add connection WCF Data Service (OData) Connection)
var plcourses = from c in Courses
orderby c.Category
select new { Title = c.Title, Lenght = c.VideoLength, Category = c.Category, Name = c.Name};
plcourses.Dump();
@teradyne
teradyne / linqpad_netflix.cs
Created January 31, 2012 18:35
Linqpad script : Get all Netflix Movies with rating > 4
//Linqpad script : Get all Netflix Movies with rating > 4
//Language: C# Expression
//Database: http://odata.netflix.com/Catalog/ (Add connection WCF Data Service (OData) Connection)
from lang in Languages
from title in lang.Titles
where lang.Name == "English" && title.Type == "Movie"
&& title.AverageRating > 4
orderby title.AverageRating descending
@teradyne
teradyne / merge_xmls.cs
Created January 31, 2012 18:31
Merge multiple XML files into single file given a node.
//Merge Multiple XML files into a single XML file with a specific node.
//For quickest result use linqpad.
//Language: C# Statement(s)
var downloadfolder = @"G:\temp\"; // your download folder where there are multiple files
string[] files = Directory.GetFiles(downloadfolder);
var masterfile = new XDocument();
XElement newDocument = new XElement("root");
@teradyne
teradyne / linqpad_tfs_changesets.cs
Created January 31, 2012 18:26
Linqpad script for retrieving TFS changesets
//Linqpad script for getting changesets based on TFS comments
// Run with language: C# statements
/*
//Use F4 in Linqpad to add these assemblies as references
<Query Kind="Statements">
<Reference>X:\TFSLib\Microsoft.TeamFoundation.Client.dll</Reference>
<Reference>X:\TFSLib\Microsoft.TeamFoundation.Common.Library.dll</Reference>
<Reference>X:\TFSLib\Microsoft.TeamFoundation.VersionControl.Client.dll</Reference>
@teradyne
teradyne / cleartemp.bat
Created December 12, 2011 19:28
clear shit from temporary files
@echo off
iisreset /stop
echo Clearing Temporary ASP.Net Files
for /d %%d in ("%SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\Temporary ASP.NET Files\*") do echo %%d && rmdir /s /q "%%d"
iisreset /start