Skip to content

Instantly share code, notes, and snippets.

View vsliouniaev's full-sized avatar

Vasily Sliouniaev vsliouniaev

View GitHub Profile
@vsliouniaev
vsliouniaev / Makefile
Created October 11, 2021 09:57
Useful makefile command syntax
help: ## Print this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort \
| awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
@vsliouniaev
vsliouniaev / Aggregating Percentiles.md
Created September 9, 2020 17:31
#LatencyTipOfTheDay: You can't average percentiles. Period.

https://latencytipoftheday.blogspot.com/2014/06/latencytipoftheday-you-cant-average.html:

I run into the following situation way too often:

You have some means of measuring and collecting latency, and you want to report on it's percentile behavior over time. You usually capture the data either in some form of high-fidelity histogram, or as raw data (each operation has it's own latency info). You then summarize the data on a per-interval basis and place it in some log. E.g. you may have a log with a summary line per interval, describing something like the 90%/ile, 95%'lie, 99%'lie, 99.9%'lie and Max of all results seen in the last 5 seconds.

Since raw data is (unfortunately) much more commonly used for this because it's hard to get accurate percentile information from most histograms, you worry about the space needed to keep the full data used to produce this summary over time. So you only keep the summaries but throw away the data.

Then you have this nice log file, with one line per summary interval, and

goroutine 4091033 [running]:
runtime/pprof.writeGoroutineStacks(0x7f4ed5aa1730, 0xc0462442d0, 0x0, 0x0)
/usr/local/go/src/runtime/pprof/pprof.go:679 +0x9d
runtime/pprof.writeGoroutine(0x7f4ed5aa1730, 0xc0462442d0, 0x2, 0x40c1d6, 0xc03bcc71e0)
/usr/local/go/src/runtime/pprof/pprof.go:668 +0x44
runtime/pprof.(*Profile).WriteTo(0x4099880, 0x7f4ed5aa1730, 0xc0462442d0, 0x2, 0xc0462442d0, 0xc1fe91b238)
/usr/local/go/src/runtime/pprof/pprof.go:329 +0x3da
net/http/pprof.handler.ServeHTTP(0xc00271120d, 0x9, 0x7f4ed5aa1660, 0xc0462442d0, 0xc0731fa300)
/usr/local/go/src/net/http/pprof/pprof.go:245 +0x33a
net/http/pprof.Index(0x7f4ed5aa1660, 0xc0462442d0, 0xc0731fa300)
# GPG - this allows signing of git commits
export GPG_TTY=$(tty)
#GO
export GOROOT=/usr/local/go
export GOPATH=/c/dev/go
export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
# git commands
gl() { git log --pretty --oneline "$@"; }
@vsliouniaev
vsliouniaev / audible-convert.sh
Created March 3, 2018 13:40
Bulk convert .aa to mp3 using ffmpeg
#!/bin/bash
for i in *.aa
do name=`echo $i | cut -d'.' -f1`;
echo $name;
ffmpeg -i "$i" -c:a libmp3lame -ac 2 -q:a 2 "${name}.mp3"
done
You fell victim to reddit formatting. Here's the easy-to-copy version.
@rem *** Disable Some Service ***
sc stop DiagTrack
sc stop diagnosticshub.standardcollector.service
sc stop dmwappushservice
sc stop WMPNetworkSvc
sc stop WSearch
sc config DiagTrack start= disabled

Keybase proof

I hereby claim:

  • I am vsliouniaev on github.
  • I am safjx (https://keybase.io/safjx) on keybase.
  • I have a public key whose fingerprint is CB98 8B08 4F02 80DF F826 228A 51A5 7E8B 9B49 3A67

To claim this, I am signing this object:

if(${env:InstalledStatusMonitor} -eq 1)
{
Write-Host "Status monitor has already been installed on this machine by this script" -ForegroundColor Green
}
Write-Host "Using chocolatey to install the Web Platform Installer ..." -ForegroundColor Green
iex ((new-object net.webclient).downloadstring('https://chocolatey.org/install.ps1'))
cinst webpi -y
Stop-Process -Name WebPlatformInstaller
using System.Reflection;
using System.Runtime.InteropServices;
[assembly: AssemblyCompany("Greenfinch Technology")]
[assembly: AssemblyCopyright("Greenfinch Technology 2014")]
[assembly: AssemblyTrademark("")]
#if DEBUG
[assembly: AssemblyConfiguration("Debug")]
#else
[assembly: AssemblyConfiguration("Release")]
;The comment below contains SFX script commands
Silent=1
Overwrite=1