Skip to content

Instantly share code, notes, and snippets.

View dejanstojanovic's full-sized avatar
🎧
Focusing

Dejan Stojanovic dejanstojanovic

🎧
Focusing
View GitHub Profile
var printMap = function(map) {
map.setOptions({
mapTypeControl: false,
zoomControl: false,
streetViewControl: false,
panControl: false
});
var popUpAndPrint = function() {
dataUrl = [];
@dejanstojanovic
dejanstojanovic / SelfHostWithAssembliesResolver.cs
Created October 6, 2015 07:33 — forked from HenrikFrystykNielsen/SelfHostWithAssembliesResolver.cs
ASP.NET Web API: Controlling assemblies loaded by providing own AssembliesResolver
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using System.Web.Http;
using System.Web.Http.Dispatcher;
using System.Web.Http.SelfHost;
namespace SelfHost
{
@dejanstojanovic
dejanstojanovic / parse-IIS-Log.cmd
Last active June 2, 2023 22:07 — forked from GuyHarwood/parse-IIS-Log.cmd
parse raw IIS logs using MS Log Parser into csv file
logparser -i:W3C -o:csv "SELECT * INTO c:\temp\results.csv FROM c:\temp\myLogFile.log"
logparser.exe "SELECT * FROM u_ex17020200.log WHERE cs-uri-query LIKE '%updvmsisdn.aspx%'" -o:CSV -q:ON -stats:OFF >> C:\Log1\output.csv
logparser.exe "SELECT * FROM u_ex*.log WHERE cs-uri-stem LIKE '%updvmsisdn.aspx%' AND cs-uri-query LIKE '%countryId=31%'" -o:CSV -q:ON -stats:OFF >> C:\Users\Administrator\Desktop\temp\output.csv
logparser.exe "SELECT * FROM u_ex17022402.log WHERE cs-uri-stem LIKE '%updvmsisdn.aspx%' AND cs-uri-query LIKE '%countryId=31%'" -o:CSV -q:ON -stats:OFF >> C:\Users\Administrator\Desktop\temp\TEMP.csv
@dejanstojanovic
dejanstojanovic / Gzip.java
Created September 1, 2016 13:20
Java gzip compress/decompress string
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.zip.GZIPInputStream;
import java.util.zip.GZIPOutputStream;
public class Gzip {
@dejanstojanovic
dejanstojanovic / mbrola-pi-setup.sh
Last active October 12, 2017 17:21 — forked from sourceperl/say_cpu_temp.py
Text to speak software with espeak and mbrola for Raspberry Pi2 (under Raspbian/jessie)
# install espeak
sudo apt-get install espeak
# install mbrola
wget http://tcts.fpms.ac.be/synthesis/mbrola/bin/raspberri_pi/mbrola.tgz
tar xvzf mbrola.tgz
chmod 755 mbrola
sudo mv ./mbrola /usr/local/bin/
# install voices for mbrola
@dejanstojanovic
dejanstojanovic / CreateIISSite
Last active January 16, 2018 17:14 — forked from ifrahim/CreateIISSite
Create IIS Site using Powershell
#unzip -> https://stackoverflow.com/questions/27768303/how-to-unzip-a-file-in-powershell
#check -> http://geekswithblogs.net/QuandaryPhase/archive/2013/02/24/create-iis-app-pool-and-site-with-windows-powershell.aspx
#check -> https://docs.microsoft.com/en-us/iis/manage/powershell/powershell-snap-in-creating-web-sites-web-applications-virtual-directories-and-application-pools
# The following code will create an IIS site and it associated Application Pool.
# Please note that you will be required to run PS with elevated permissions.
# Visit http://ifrahimblog.wordpress.com/2014/02/26/run-powershell-elevated-permissions-import-iis-module/
@dejanstojanovic
dejanstojanovic / install-kubernetes-on-buster.sh
Created June 12, 2021 06:41 — forked from BeerOnBeard/install-kubernetes-on-buster.sh
Set up a single-node Kubernetes system on Debian 10 (Bustomer). Use Flannel as the network fabric. Install the Kubernetes dashboard.
#!/bin/bash
set -e;
# Set up a single-node Kubernetes system on Debian 10 (Buster).
# Use Flannel as the network fabric. Install the Kubernetes
# dashboard.
# disable swap
swapoff -a;
@dejanstojanovic
dejanstojanovic / Local-Kubernetes.md
Created September 28, 2021 06:03 — forked from dahlsailrunner/Local-Kubernetes.md
Helpful tips and snippets for Kubernetes within Docker Desktop

Using the K8s Dashboard Locally

Actual repo is here: https://github.com/kubernetes/dashboard

1. Install the Dashboard

kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/v2.1.0/aio/deploy/recommended.yaml

2. Create a Sample User Account that can Access the Dashboard via Token

kubectl apply -f https://gist.githubusercontent.com/dahlsailrunner/bbd453f3bb6259b66c08a70d0908283f/raw/5727723217e2df4b65d8933adf04d009cfb0fe3f/local-dashboard-account.yml