Skip to content

Instantly share code, notes, and snippets.

View ashishnegi's full-sized avatar

Ashish Negi ashishnegi

  • Software Developer
  • Austin, TX
View GitHub Profile
========== Publishing ==========
Packaging Application...
Build started 12/11/2018 4:35:49 PM.
Building with tools version "15.0".
Target SFAppGetApplicationName:
Using "GetApplicationName" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Sdks\Microsoft.SFApp.Sdk\build\..\tools\Microsoft.VisualStudio.Azure.SFApp.BuildTasks.dll".
Task "GetApplicationName"
Done executing task "GetApplicationName".
Target SFAppFindServiceProjects:
Using "FindServiceProjects" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\Preview\Enterprise\MSBuild\Sdks\Microsoft.SFApp.Sdk\build\..\tools\Microsoft.VisualStudio.Azure.SFApp.BuildTasks.dll".
@ashishnegi
ashishnegi / dotnet_network_service_mode.csv
Created October 30, 2017 13:29
Procmon logs when dotnet runs as network service
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 7.
"CreateFile","D:\Users\testadm\dotnet\dotnet.exe","ACCESS DENIED","Desired Access: Read Data/List Directory, Synchronize, Disposition: Open, Options: Synchronous IO Non-Alert, Non-Directory File, Attributes: n/a, ShareMode: Read, Delete, AllocationSize: n/a"
"QueryOpen","D:\Users\testadm\dotnet\host\fxr","ACCESS DENIED",""
```
Full Process Monitor log here :
```
"Time of Day","Process Name","PID","Operation","Path","Result","Detail"
"1:05:34.9220360 PM","dotnet.exe","1084","Process Start","","SUCCESS","Parent PID: 2376, Command line: ""D:\Users\testadm\dotnet\dotnet.exe"" --version , Current directory: D:\Windows\system32\, Environment:
; ALLUSERSPROFILE=D:\ProgramData
; APPDATA=D:\Windows\ServiceProfiles\NetworkService\AppData\Roaming
@ashishnegi
ashishnegi / dotnet_admin_mode.csv
Created October 30, 2017 13:28
Dotnet procmon logs when running as admin
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
"Time of Day","Process Name","PID","Operation","Path","Result","Detail"
"1:24:35.1974924 PM","dotnet.exe","2380","Process Start","","SUCCESS","Parent PID: 2644, Command line: D:\Users\testadm\dotnet\dotnet.exe --version, Current directory: D:\Users\testadm\Downloads\SysinternalsSuite\, Environment:
; =::=::\
; =D:=D:\Users\testadm\Downloads\SysinternalsSuite
; =ExitCode=80008083
; ALLUSERSPROFILE=D:\ProgramData
; APPDATA=D:\Users\testadm\AppData\Roaming
; CLIENTNAME=ASNEGI-PC
; CommonProgramFiles=D:\Program Files\Common Files
; CommonProgramFiles(x86)=D:\Program Files (x86)\Common Files
@ashishnegi
ashishnegi / chan_patterns.clj
Created April 18, 2017 08:59
principles and patterns of core async channels
(ns learn-clj.chan-patterns
(:require [clojure.core.async :as async]))
;; first create a channel..
(def mychan (async/chan))
;; # principles
;; #1 : taking/putting on a channel blocks if no one is putting/taking from it.
;; => can cause deadlocks if done synchronously.
;; so, do everything asynchronous or max 1 operation synchronous.
-- Sometimes we want to decode value of type a from a json list of a.. but each with some little differences..
-- Like server sends json: [{"name" : "a"},{"name" : "b"}]
-- and we have
type alias Player =
{ name : String
, color : Color
}
-- color is view specific and server is not sending it..
@ashishnegi
ashishnegi / problem-quartz.clj
Created February 19, 2016 12:10
My problem with quartz.
Thanks for quartzite.
I am trying to make quartz work with jdbc store. However, i find that new jobs are not triggering.
I can see all new jobs and triggers in my database. My `defjobs` from another files also work.
It is just that jobs are not getting triggered.
My scheduler code is :
```clj
(ns theophrastus.utils
(:require [clojurewerkz.quartzite.scheduler :as qsched]
[clojurewerkz.quartzite.triggers :as qtrigger]
@ashishnegi
ashishnegi / simpleparser1.hs
Created June 2, 2015 10:31
Simple parser from `Write Yourself a Scheme` in Haskell.
module Main where
import System.Environment
import Text.ParserCombinators.Parsec hiding (spaces)
import Control.Monad
import Numeric
import Data.Char (digitToInt, toLower)
-- our symbols are defined in here.
-- our word should start from one of these.
symbol :: Parser Char
@ashishnegi
ashishnegi / incidents-cluster-nearby.js
Created May 1, 2015 12:07
Cluster the reported incidents by their locations and category-id. *Not well tested.*
/*
* Fetch the data from public api.
* categorize the incidents in groups of
* {
category-id : [
for-each-category-a-list-of-list-of-incidents.
A-list-of-incidents : stores some nearby incidents.
]
}
@ashishnegi
ashishnegi / cppfileparse.cpp
Last active August 29, 2015 14:19
Gets the function name and arguments : (problem with default values in function signature)
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cctype>
#include <map>
namespace patch
{
@ashishnegi
ashishnegi / neural.clj
Last active August 29, 2015 14:19
Simple Logical gates : forward and backward pass in neuron function (x, y) = sigmoid(a*x + b*y + c)
;; a single unit has forward value and backward gradient.
(defrecord Unit
[value gradient])
(defrecord Gate
[^:Unit input-a ^:Unit input-b])
(defprotocol GateOps
(forward [this])
(backward [this back-grad]))