Skip to content

Instantly share code, notes, and snippets.

View ajai8085's full-sized avatar
🎯
Focusing

Ajai ajai8085

🎯
Focusing
View GitHub Profile
@ajai8085
ajai8085 / Install NVM.md
Created February 4, 2019 09:41
Install NVM on Fedora

Install NVM on Fedora

1. Install node and NPM:

sudo dnf install -y nodejs npm

2. Install NVM via NPM:

@ajai8085
ajai8085 / TSQL-to-POCO
Created August 21, 2017 01:16 — forked from joey-qc/TSQL-to-POCO
A simple TSQL script to quickly generate c# POCO classes from SQL Server tables and views. You may tweak the output as needed. Not all datatypes are represented but this should save a bunch of boilerplate coding. USAGE: Run this query against the database of your choice. The script will loop through tables, views and their respective columns. Re…
declare @tableName varchar(200)
declare @columnName varchar(200)
declare @nullable varchar(50)
declare @datatype varchar(50)
declare @maxlen int
declare @sType varchar(50)
declare @sProperty varchar(200)
DECLARE table_cursor CURSOR FOR
@ajai8085
ajai8085 / gist:18617a2eed10305097fb08e5dda6e63c
Created August 17, 2017 05:24 — forked from learncodeacademy/gist:5f84705f2229f14d758d
Getting Started with Vagrant, SSH & Linux Server Administration
# SSH Agent Functions
# Mark Embling (http://www.markembling.info/)
#
# How to use:
# - Place this file into %USERPROFILE%\Documents\WindowsPowershell (or location of choice)
# - Import into your profile.ps1:
# e.g. ". (Resolve-Path ~/Documents/WindowsPowershell/ssh-agent-utils.ps1)" [without quotes]
# - Enjoy
#
# Note: ensure you have ssh and ssh-agent available on your path, from Git's Unix tools or Cygwin.
@ajai8085
ajai8085 / Powershell
Created August 14, 2017 03:38 — forked from nulltier/Powershell
usefull commands for ssh-agent in powershell
Get-SshAgent - Returns the process ID of the running agent, or zero if there is not one currently running.
Start-SshAgent - Starts the agent process and sets the appropriate environment variables for SSH.
Stop-SshAgent - Stops the process if there is one and unsets the variables.
Add-SshKey - Instructs the agent to add the given key to itself. This will cause you to be prompted for the passphrase.
@ajai8085
ajai8085 / make-keys.bat
Created November 22, 2016 23:55 — forked from codingoutloud/make-keys.bat
Handy OpenSSL command-line combinations I've used - they might've been hard to find or come up with, so capturing them here.
@echo off
if _%1_==__ goto USAGE
openssl req -x509 -nodes -days 365 -newkey rsa:1024 -keyout mycert.pem -out mycert.pem -subj "/CN=My Cert Name"
openssl pkcs12 -export -out mycert.pfx -inkey mycert.pem -in mycert.pem -passout pass:%1
openssl x509 -inform pem -in mycert.pem -outform der -out mycert.cer
openssl pkcs12 -in mycert.pfx -nodes -passin pass:%1 | openssl x509 -noout -fingerprint
openssl x509 -in mycert.pem -noout -fingerprint
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Threading;
namespace WpfApplication1
{
public class AsyncObservableCollection<T> : ObservableCollection<T>
{
private readonly SynchronizationContext _synchronizationContext = SynchronizationContext.Current;