Skip to content

Instantly share code, notes, and snippets.

View KristofferRisa's full-sized avatar

Kristoffer Risa KristofferRisa

View GitHub Profile
@KristofferRisa
KristofferRisa / Get-Azure-Service-Principal-credentials.ps1
Created June 6, 2020 07:49
Get Azure Service Principal credentials
az ad sp create-for-rbac --name "myApp" --role contributor --scopes /subscriptions/{subscription-id}/resourceGroups/{resource-group} --sdk-auth
@KristofferRisa
KristofferRisa / docker-compose.yml
Created May 12, 2020 10:16
docker-compose mongodb
version: '3.7'
services:
mongodb_container:
image: mongo:latest
environment:
MONGO_INITDB_ROOT_USERNAME: user
MONGO_INITDB_ROOT_PASSWORD: supersecretpassword
ports:
- 27017:27017
volumes:
@KristofferRisa
KristofferRisa / check-http-stub-status-module
Last active November 22, 2019 19:46
Nginx monitor setup
nginx -V 2>&1 | grep -o with-http_stub_status_module
@KristofferRisa
KristofferRisa / Create a SymLink linux.sh
Created November 22, 2019 16:06
Most used linux commands
@KristofferRisa
KristofferRisa / git-add.sh
Last active September 1, 2019 07:50
Just some basic git commands. (used in kristoffer.dev/blog/basic-git-commands)
# adds files to index
git add <file>
@KristofferRisa
KristofferRisa / v-cloak-exmple.vue
Created July 6, 2019 12:07
Vue.js tips and tricks
<template>
<div v-cloak >
</div>
</template>
<style>
[v-cloak] {
display: none;
}
</style>
@KristofferRisa
KristofferRisa / map-unique.js
Created July 6, 2019 12:04
JavaScripts ES6 tips and tricks
const unique = [...new Set(array.map(item => item.age))];
@KristofferRisa
KristofferRisa / Get-AppPools.ps1
Created December 19, 2018 12:31
Powershell commands for IIS administrating
Get-IISAppPool | where name -like *webclient* | select Name, state,queuelength
@KristofferRisa
KristofferRisa / messagesonqueue.ps1
Last active December 16, 2018 10:53
Administrating Msmq with Powershell
get-msmqqueue | where messagecount -gt 0 | select queuename, MessageCount
@KristofferRisa
KristofferRisa / Find-Proposed-Index.sql
Created December 11, 2018 13:45
Find Proposed Index T-SQL
SELECT CAST(SERVERPROPERTY('ServerName') AS [nvarchar](256)) AS [SQLServer]
,db.[database_id] AS [DatabaseID]
,db.[name] AS [DatabaseName]
,id.[object_id] AS [ObjectID]
,id.[statement] AS [FullyQualifiedObjectName]
,id.[equality_columns] AS [EqualityColumns]
,id.[inequality_columns] AS [InEqualityColumns]
,id.[included_columns] AS [IncludedColumns]
,gs.[unique_compiles] AS [UniqueCompiles]
,gs.[user_seeks] AS [UserSeeks]