Skip to content

Instantly share code, notes, and snippets.

View aleksamagicka's full-sized avatar

Aleksa Savić aleksamagicka

  • Microsoft
View GitHub Profile
@aleksamagicka
aleksamagicka / print-binary-tree.c
Created April 15, 2020 08:18 — forked from obstschale/print-binary-tree.c
Print a binary tree
void padding ( char ch, int n ){
int i;
for ( i = 0; i < n; i++ )
putchar ( ch );
}
void structure ( struct node *root, int level ){
int i;
@aleksamagicka
aleksamagicka / Office_kms
Created February 24, 2019 18:52 — forked from CHEF-KOCH/KMS_office.cmd
KMS server Windows
cd\Program Files\Microsoft Office\Office16
cd\Program Files (x86)\Microsoft Office\Office16
cscript OSPP.VBS /sethst:kms.digiboy.ir
cscript OSPP.VBS /actcscript OSPP.VBS /dstatus
slmgr.vbs /ckms
@aleksamagicka
aleksamagicka / getLatestIstio.ps1
Created October 7, 2018 18:48 — forked from kameshsampath/getLatestIstio.ps1
The PowerShell script that can be used to download latest version of Istio analogus to https://git.io/getLatestIstio
param(
[string] $IstioVersion = "0.3.0"
)
$url = "https://github.com/istio/istio/releases/download/$($IstioVersion)/istio_$($IstioVersion)_win.zip"
$Path = Get-Location
$output = [IO.Path]::Combine($Path, "istio_$($IstioVersion)_win.zip)
Write-Host "Downloading Istio from $url to path " $Path -ForegroundColor Green
@aleksamagicka
aleksamagicka / create-registry.sh
Created September 19, 2018 08:01 — forked from ajbouh/create-registry.sh
Create a private Docker registry on a fresh Kubernetes Cluster
set -ex
REGISTRY_INGRESS_IP=10.73.177.23
REGISTRY_INGRESS_REGISTRY_INGRESS_HOSTNAME=registry.$REGISTRY_INGRESS_IP.xip.io
# if [ ! -e $REGISTRY_INGRESS_HOSTNAME.key ]; then
# echo '{"CN":"'$REGISTRY_INGRESS_HOSTNAME'","hosts":[""],"key":{"algo":"rsa","size":2048}}' | cfssl gencert -config=ca-config.json -ca=ca.pem -ca-key=ca-key.pem -hostname="$REGISTRY_INGRESS_HOSTNAME" - | cfssljson -bare $REGISTRY_INGRESS_HOSTNAME
# fi
# juju ssh easyrsa/0
@aleksamagicka
aleksamagicka / ffmpeg-hevc-encode-nvenc.md
Created November 7, 2017 08:43
This gist shows you how to encode specifically to HEVC with ffmpeg's NVENC on supported hardware, with a two-pass profile and optional CUVID-based hardware-accelerated decoding.

Encoding high-quality HEVC content with FFmpeg - based NVENC encoder on supported hardware:

If you've built ffmpeg as instructed here on Linux and the ffmpeg binary is in your path, you can do fast HEVC encodes as shown below, using NVIDIA's NPP's libraries to vastly speed up the process.

Now, to do a simple NVENC encode in 1080p, (that will even work for Maxwell Gen 2 (GM200x) series), start with:

ffmpeg  -i <inputfile>  \
-filter:v hwupload_cuda,scale_npp=w=1920:h=1080:format=nv12:interp_algo=lanczos,hwdownload \

-c:v hevc_nvenc -profile main -preset slow -rc vbr_hq \

@aleksamagicka
aleksamagicka / nvenc-capabilities-ffmpeg.md
Created September 1, 2017 13:51 — forked from Brainiarc7/nvenc-capabilities-ffmpeg.md
See the supported NVENC and NPP capabilities in your FFmpeg build

Quickly check for supported NVENC and NPP hardware acceleration capabilities in FFmpeg on your platform:

Depending on how you built ffmpeg, you may want to check the supported NVENC-based hardware acceleration capabilities in ffmpeg by running:

$ for i in encoders decoders filters; do
    echo $i:; ffmpeg -hide_banner -${i} | egrep -i "npp|cuvid|nvenc|cuda"
done

Sample output (as on my testbed):

@aleksamagicka
aleksamagicka / waifu.sh
Created July 14, 2017 09:58 — forked from frantic1048/waifu.sh
waifu2x batch operation wrapper
#!/bin/bash
waifu () {
if [[ $# -eq 0 ]]; then
cat << EOF
Usage: waifu [OPTIONS] FILE1 [FILE2 ...]
Options:
-d dry run, just print out the commands to exec.
const WebSocket = require('ws');
const fs = require('fs');
var gameURL = 'ws://csgopoor.com:2052/socket.io/?EIO=3&transport=websocket'; //socket adress, can be checked in your browser (developer tools -> network -> websockets)
var depositURL = '';//csgopoor bot deposit url
var SteamCommunity = require('steamcommunity');
var SteamTotp = require('steam-totp');
var TradeOfferManager = require('steam-tradeoffer-manager');
var steam = new SteamCommunity();
var manager = new TradeOfferManager({
"language": "en", // We want English item descriptions
@aleksamagicka
aleksamagicka / steam_console_params.txt
Created January 26, 2017 16:58 — forked from davispuh/steam_console_params.txt
Steam client parameters, consoles commands and variables
-480p - Run tenfoot in 480p rather than 1080p
-720p - Run tenfoot in 720p rather than 1080p
-accountrecovery - Perform account recovery
-all_languages - show longest loc string from any language
-bigpicture - Start in Steam Big Picture mode
-cafeapplaunch - Launch apps in a cyber cafe context
-candidates - Show libjingle candidates for local connection as they are processed
-ccsyntax - Spew details about the localized strings we load
-community - Set the community URL
-complete_install_via_http - Run installation completion over HTTP by default
@aleksamagicka
aleksamagicka / test.cpp
Created September 25, 2016 11:00 — forked from m4dEngi/test.cpp
#define STEAMWORKS_CLIENT_INTERFACES
#include "Steamworks.h"
CSteamAPILoader loader;
IClientEngine *pClientEngine;
IClientUser *pClientUser;
HSteamPipe hPipe = -1;