Skip to content

Instantly share code, notes, and snippets.

View evil-shrike's full-sized avatar

Sergei Dorogin evil-shrike

  • Google
  • Dubai
View GitHub Profile

Keybase proof

I hereby claim:

  • I am evil-shrike on github.
  • I am segy (https://keybase.io/segy) on keybase.
  • I have a public key ASAR2pY4B6Pok-xAOczI4JCZwZZeYQDNLfnQ2uutcycGzAo

To claim this, I am signing this object:

@evil-shrike
evil-shrike / cloudbuild.yaml
Created June 8, 2020 12:56
A sample cloudbuild for building a Docker image and restarting a VM based on it
steps:
# Build the app
- name: 'gcr.io/cloud-builders/dotnet'
args: [ 'publish', '-c', 'Release' ]
# Build the app image.
- name: 'gcr.io/cloud-builders/docker'
args: [ 'build', '-t', 'gcr.io/$PROJECT_ID/dich-google-bot', '.' ]
dir: './bin/Release/netcoreapp2.1/publish'
@evil-shrike
evil-shrike / vast.xml
Created March 4, 2020 15:12
VAST response from AM with multiple ads
<?xml version="1.0" encoding="UTF-8"?>
<VAST xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vast.xsd" version="4.0">
<Ad id="420479014309" sequence="1">
<Wrapper>
<AdSystem>AdSense/AdX</AdSystem>
<VASTAdTagURI><![CDATA[https://bid.g.doubleclick.net/dbm/vast?dbm_c=AKAmf-CCdDG2KjFmZkj7kQn5pSYleAomRGNJYH9Ewi_ENnVk-CMkWw2yZ6BepKvsVgkkHYt8T4WzfHSRxAREc57iAIEphb2fDQ&dbm_d=AKAmf-DZD9RsN-eFS-4gTiSXkAsUprCsPqIxlF1DqH_HfHm-j773K4XKYfduADKZZc4QyajksoxK74E9y_90dKVavuDz98CiW1bzp9KOVcgkwco6uLdw12mzhblcZW4yng03G-VGD7VpjTC6u2Mx-LsEbRnsFrFTFp32TJAkDmcAlqBs_TH6x7h1nBpECDy-t2VW16Rb35gvT0bq9MtZPOtCSu-3co-TdFpX9p8Cp4AT2kpBLPobdIJHb47UbyeMbMaOL7COG2dzJ1iEmyusbeIquQeFw7IZ4braaXE7yIbaAw82W9fX_bOu0BEaphbLz4o-xTHFnDSMP5L6eGXYuAvgfyHRAiiDVj3gEUwjyYahuzwmRhmPYmcGdVU6uYu9bMv7IOM6AnZGqPEjqmZXfOFW2KRjW79Kcnk8Hm6s_cOnRbdVtmkAvT-OzyK059LYcaTz0GuQLnAv3WvJh7cHESXuXObzYOTrU-gdAl53P76vaAuTa710gXyBTn2TEijCKKbEqPXMImNOBBElLcbfsnRC53KCmc8UXHWN2SaWV-cuGHeeeyAS8obSwp-nwSGNp51tqR3KHfzN1IW-Txyxo6QrfMWNw9K3
# collect local path of all files with pending Adds
$pendingAdds = Get-TfsPendingChange -Item ./* -Recurse | Select-Object -ExpandProperty "LocalItem"
# Phase 1: add all local files into TFS which aren't under source control yet
$items = Get-ChildItem -Recurse
foreach($item in $items)
{
$localItem = $item.FullName
$serverItem = Get-TfsChildItem -Item "$localItem"
if (!$serverItem -and !($pendingAdds -contains $localItem)) {
@evil-shrike
evil-shrike / artifactory-publisher-sample.js
Created October 18, 2016 11:53
artifactory-publisher example usage
var fs = require("fs");
var path = require("path");
var Q = require("Q");
var async = require("async");
var publisher = require("artifactory-publisher");
var artUrlBase = "http://artifacts.mydomain.com/my-repo/";
var options = {
credentials: {
@evil-shrike
evil-shrike / generate-word.ps1
Created October 14, 2016 10:49
Dump content of all text files into a Word document
Param(
[String]$basePath,
[String[]]$Include=@("*.cs"),
[string[]]$ignoreFiles=@(),
[string[]]$ignorePath=@()
)
function Resolve-RelativePath($path, $fromPath) {
$path = Resolve-Path $path
$fromPath = Resolve-Path $fromPath
[CmdletBinding()]
Param(
[Parameter(Position=1)]
[String]$basePath,
[String[]]$Include=@("*.cs")
)
function Resolve-RelativePath($path, $fromPath) {
$path = Resolve-Path $path
$fromPath = Resolve-Path $fromPath
@evil-shrike
evil-shrike / fix-encoding.ps1
Last active October 30, 2016 10:31
PS script to fix files encoding
[CmdletBinding()]
Param(
[Parameter(Position=1)]
[String]$basePath,
[String[]]$Include=@("*.cs")
)
# Load the library which expected to be beside the script
$scriptPath = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
Add-Type -Path $scriptPath\Ude.dll
@evil-shrike
evil-shrike / gist:fc032ed7c4205d0df5a1
Created November 25, 2014 15:21
npm adduser issue
0 info it worked if it ends with ok
1 verbose cli [ 'Z:\\Prog\\nodejs\\\\node.exe',
1 verbose cli 'Z:\\Prog\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli '-d',
1 verbose cli 'adduser' ]
2 info using [email protected]
3 info using [email protected]
4 verbose node symlink Z:\Prog\nodejs\\node.exe
5 verbose config Skipping project config: C:\Users\Shrike/.npmrc. (matches userconfig)
6 verbose adduser before first PUT { _id: 'org.couchdb.user:shrike',