Skip to content

Instantly share code, notes, and snippets.

View kruttaras's full-sized avatar

Taras Krutiak kruttaras

View GitHub Profile
@kruttaras
kruttaras / MIKROTIK_RESTART_3G.MD
Last active April 6, 2018 23:28
Mikrotik USB 3G modem restart
system routerboard usb power-reset duration=15s
@kruttaras
kruttaras / application.properties
Created January 29, 2018 15:40
How to disable Consul discovery and set static address for `@FeignClient( name="<service-name>")`
<service-name>.ribbon.listOfServers=<ip:port>
spring.cloud.bus.enabled=false
spring.cloud.consul.discovery.enabled=false
spring.cloud.consul.enabled=false
@kruttaras
kruttaras / MyReflectionTestUtils.java
Created June 1, 2017 10:09 — forked from apachesun/MyReflectionTestUtils.java
Use reflection to compare getters on two objects
/**
*
*/
package com.mypackage.utilities;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import org.apache.commons.lang.builder.EqualsBuilder;
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
int to_hex(char* hex, int i)
{
int size = (int)strlen(hex);
int dec_part;
@kruttaras
kruttaras / integration-database-from-oracle-database-docker-image.xml
Created February 24, 2017 00:23 — forked from michael-simons/integration-database-from-oracle-database-docker-image.xml
Stanza from a Maven pom.xml that creates an integration database from oracle/database docker image, adds a user and a tablespace through a sql file
<build>
<plugins>
<plugin>
<groupId>io.fabric8</groupId>
<artifactId>docker-maven-plugin</artifactId>
<version>0.15.16</version>
<configuration>
<images>
<image>
<name>enerko/ihldb</name>
@kruttaras
kruttaras / uri.js
Created November 28, 2016 14:57 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@kruttaras
kruttaras / add_intellij_launcer
Created November 11, 2016 22:03 — forked from rob-murray/add_intellij_launcer
Add Intellij launcher shortcut and icon for ubuntu
// create file:
sudo vim /usr/share/applications/intellij.desktop
// add the following
[Desktop Entry]
Version=13.0
Type=Application
Terminal=false
Icon[en_US]=/home/rob/.intellij-13/bin/idea.png
Name[en_US]=IntelliJ
#include <iostream>
#include <math.h>
using namespace std;
int main() {
cout<<"e= "<<M_E<<endl;
float z = 33.8461;
int b = -11, c = (int) z, g = 0x21;
@kruttaras
kruttaras / configure_docker0.sh
Created November 2, 2016 11:32 — forked from kamermans/configure_docker0.sh
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# You can run this script directly from github as root like this:
# curl -sS https://gist.githubusercontent.com/kamermans/94b1c41086de0204750b/raw/configure_docker0.sh | sudo bash -s - 192.168.254.1/24
#
# * Make sure you replace "192.168.254.0/24" with the network that you want to use
#
# NOTE: This script is intended for Debian / Ubuntu only!
if [ $# -lt 1 ]; then
@kruttaras
kruttaras / Singleton.cs
Created June 2, 2016 21:14
Сингтони для 11 завдання
public class Line
{
private int x1;
private int x2;
private int y1;
private int y2;
private static Line instance;