Skip to content

Instantly share code, notes, and snippets.

View georgiyordanov's full-sized avatar

Georgi Yordanov georgiyordanov

View GitHub Profile
@georgiyordanov
georgiyordanov / pam-tid-sudo.sh
Created January 23, 2023 17:03 — forked from steigr/pam-tid-sudo.sh
Enable TouchID-support with sudo
#!/usr/bin/env bash
sudo sed -i '' -e '/^#/a\'$'\n''auth sufficient pam_tid.so' /etc/pam.d/sudo
@georgiyordanov
georgiyordanov / self-signed-certificate-with-custom-ca.md
Last active March 1, 2022 11:41 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@georgiyordanov
georgiyordanov / osx_setup.md
Last active June 14, 2024 07:57 — forked from angelyordanov/osx_setup.md
Mac OS X setup

Setup Mac OS X

Setup

1. Before setup

Make sure everything is up to date. Wait for FileVault to finish encrypting the hard drive.

@georgiyordanov
georgiyordanov / search_query_plan_cache.sql
Created February 10, 2020 13:10
Search the SQL Server query plan cache
SELECT
databases.name,
dm_exec_sql_text.text AS TSQL_Text,
dm_exec_query_stats.creation_time,
dm_exec_query_stats.execution_count,
dm_exec_query_stats.total_worker_time AS total_cpu_time,
dm_exec_query_stats.total_elapsed_time,
dm_exec_query_stats.total_logical_reads,
dm_exec_query_stats.total_physical_reads,
dm_exec_query_plan.query_plan
@georgiyordanov
georgiyordanov / index.js
Created March 27, 2019 15:24
Add custom headers to chrome
const chromeLauncher = require('chrome-launcher');
const CDP = require('chrome-remote-interface');
async function main() {
const chrome = await chromeLauncher.launch({
chromeFlags: [
'--window-size=1200,800',
`--user-data-dir=/tmp/chrome-data-dir`,
'--auto-open-devtools-for-tabs'
]
@georgiyordanov
georgiyordanov / normalize.sh
Last active February 15, 2019 12:40
Normalize all files in a git repo to LF
#!/usr/bin/env bash
# Check current status
git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD --name-only | xargs dos2unix -i --
# Convert all files to LF and UTF-8 without BOM
git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD --name-only | xargs dos2unix -r --
# Check for tabs
git diff 4b825dc642cb6eb9a060e54bf8d69288fbee4904 HEAD --name-only | xargs grep -e "^\t" --
'use strict';
/*global require, module, process*/
/*jshint -W097*/ // Use the function form of "use strict".
var _ = require('lodash'),
glob = require('glob'),
minimatch = require('minimatch'),
glob2base = require('glob2base'),
path = require('path');
_.str = require('underscore.string');