Skip to content

Instantly share code, notes, and snippets.

View LadislavSopko's full-sized avatar

Ladislav Sopko LadislavSopko

View GitHub Profile
<#
.SYNOPSIS
Stands up a mongo replica set that consists of 1 primary, 1 secondary, 1 hidden secondary and 1 arbiter.
.DESCRIPTION
.PARAMETER mongoPath
Path to mongo /bin dir.
.PARAMETER dbRoot
@LadislavSopko
LadislavSopko / Download and Install MongoDB as Windows Service PowerShell Script
Created November 28, 2020 22:13 — forked from serdarb/Download and Install MongoDB as Windows Service PowerShell Script
A nice powershell that dowloads mongodb and installs it as windows service... this script is good for development machines.
Set-ExecutionPolicy RemoteSigned
$mongoDbPath = "C:\MongoDB"
$mongoDbConfigPath = "$mongoDbPath\mongod.cfg"
$url = "http://downloads.mongodb.org/win32/mongodb-win32-x86_64-2008plus-2.4.9.zip"
$zipFile = "$mongoDbPath\mongo.zip"
$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-2.4.9"
if ((Test-Path -path $mongoDbPath) -eq $True)
{
#
# MongoDB (as a windows service)
#
$mongoDbPath = "$env:SystemDrive\MongoDB"
$mongoDbConfigPath = "$mongoDbPath\mongod.cfg"
$url = "https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-3.2.7.zip"
$zipFile = "$mongoDbPath\mongo.zip"
$unzippedFolderContent ="$mongoDbPath\mongodb-win32-x86_64-2008plus-3.2.7"
if ((Test-Path -path $mongoDbPath) -eq $false)
@LadislavSopko
LadislavSopko / c_cpp_properties_for_arm_toolchain.md
Created December 16, 2018 20:02 — forked from kbumsik/c_cpp_properties_for_arm_toolchain.md
VS Code c_cpp_properties.json example for arm-none-eabi toochain

VS Code c_cpp_properties.json example for arm-none-eabi toochain

If you installed C/C++ extension for Visual Studio Code but using GNU Arm Embedded Toolchain for ARM Cortex M series MCU target, VS Code will keep prompt "Configuring includePath for better IntelliSense results". You wil need a special c_cpp_properties.json for the ARM toolchain.

This works on both Linux and Windows.

  1. For arm-none-eabi-gcc users, its compiler include path should be included first. It differes in each system. Use the verbose arm-none-eabi-gcc -v flag to see include list. change "includePath" and "browse"."path" for your sys
@LadislavSopko
LadislavSopko / DefaultQueryDslDeserializer.java
Created November 1, 2018 11:35 — forked from ascott42/DefaultQueryDslDeserializer.java
Querydsl Predicate/OrderSpecifier into JSON
package com.asis.kis.persistence.core.querydsl;
import com.asis.kis.base.commons.stream.SimpleStreams;
import com.asis.kis.commons.util.JsonTypeConverter;
import com.asis.kis.commons.util.Jsons;
import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.common.base.CaseFormat;
import com.google.common.collect.Lists;
import com.querydsl.core.types.EntityPath;
@LadislavSopko
LadislavSopko / zsockmon.c
Created November 24, 2016 12:35 — forked from claws/zsockmon.c
A candidate CZMQ implementation for a ZMQ socket event monitor.
// Monitor socket transport events (tcp and ipc only)
#include "../include/czmq.h"
// remove this when zsockmon.h is properly moved into ../include
// and added to ../include/czmq.h (via adding to model/project.xml)
#include "zsockmon.h"
/**
* version1: convert online image
* @param {String} url
* @param {Function} callback
* @param {String} [outputFormat='image/png']
* @author HaNdTriX
* @example
convertImgToBase64('http://goo.gl/AOxHAL', function(base64Img){
console.log('IMAGE:',base64Img);
})