Skip to content

Instantly share code, notes, and snippets.

@DerfOh
DerfOh / install-windows-exporter.ps1
Created October 8, 2022 00:10
installs windows prometheus exporter
$version = "0.20.0"
$AgentURL = "https://github.com/prometheus-community/windows_exporter/releases/download/v${version}/windows_exporter-${version}-amd64.exe"
$AbsoluteCurrPath = $(Get-Location).Path
$ExporterDirectoryToCreate = "C:\Program Files\windows_exporter\"
$AbsolutePathExe = "${ExporterDirectoryToCreate}\windows_exporter.exe"
$EnabledCollectors = "cpu,cs,logical_disk,memory,net,os,service,system,tcp,remote_fx,logon,process"
$ServiceName = "windows_exporter"
# create exporter directory
@DerfOh
DerfOh / install-sql-exporter.ps1
Created October 7, 2022 14:36
Installs sql exporter and configurations
$version = "0.9.1"
$AgentURL = "https://github.com/burningalchemist/sql_exporter/releases/download/${version}/sql_exporter-${version}.windows-amd64.zip"
$AbsoluteCurrPath = $(Get-Location).Path
$AbsolutePathZip = "${AbsoluteCurrPath}\tmp\sql-exporter\sql_exporter.zip"
$ServiceName = "sql_exporter"
$TempDirectoryToCreate = "$AbsoluteCurrPath\tmp\sql-exporter"
$SQL_EXPORTER_PATH = "C:\sql-exporter"
$ExporterDirectoryToCreate = "C:\sql-exporter"
# Default is localhost, can be changed if the exporter needs to be remote
# 'sqlserver://${DbUser}:${DbPassword}@${DbAddress}:${DbPort}'

Keybase proof

I hereby claim:

  • I am derfoh on github.
  • I am derfoh (https://keybase.io/derfoh) on keybase.
  • I have a public key whose fingerprint is 455B 12C4 3464 76B8 9808 2F98 363F 303C B42E BBBC

To claim this, I am signing this object:

@DerfOh
DerfOh / ssl-date-check.md
Created January 13, 2017 14:53
How to check the SSL cert expiration date using command

How to check the SSL cert expiration date using command

echo | openssl s_client -connect www.google.com:443 2>/dev/null | openssl x509 -noout -dates
@DerfOh
DerfOh / add-keys.md
Last active January 2, 2017 06:32
Add SSH Keys to server

How to add your ssh keys in one line

cat ~/.ssh/id_rsa.pub | ssh user@hostname "mkdir -p ~/.ssh && cat >>  ~/.ssh/authorized_keys"
@DerfOh
DerfOh / cygwin-arrow-key-fix.md
Created December 23, 2016 19:44
cygwin change ctrl+arrow to normal mvmt behavior

Add the following lines to ~/.inputrc (C:\cygwin\home<username>.inputrc):

"\e[1;5C": forward-word   # ctrl + right
"\e[1;5D": backward-word  # ctrl + left 
@DerfOh
DerfOh / .vimrc
Created December 23, 2016 13:41
my .vimrc
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=/cygdrive/c/Users/fpaulin/.vim/bundle/Vundle.vim
call vundle#begin()
" alternatively, pass a path where Vundle should install plugins
"call vundle#begin('~/some/path/here')
" let Vundle manage Vundle, required
@DerfOh
DerfOh / change script execution.md
Created December 21, 2016 20:49
change execution mode of a shell script that is written on windows
git update-index --chmod=+x foo.sh

git ls-files --stage
@DerfOh
DerfOh / dos2unix-recursive.md
Last active December 21, 2016 18:09
convert all files in a dir to unix using dos2unix

Convert all files in a directory to Unix format

  1. Set up dos2unix

  2. Run the following in the directory

find . -type f -exec dos2unix {} \;
@DerfOh
DerfOh / cygwin-colors-email.md
Last active December 21, 2016 17:42
Changing cygwin colors

ls --color scheme

From: "Robert Mark Bram"

To: "Cygwin"

Date: Wed, 12 Jun 2002 02:44:32 +1000

Subject: ls --color scheme

Howdy all!

For the record, this is what I have found out about changing ls color scheme.