Skip to content

Instantly share code, notes, and snippets.

View barlog-m's full-sized avatar
😕
Have seen some bugs...

Barlog M. barlog-m

😕
Have seen some bugs...
View GitHub Profile
@barlog-m
barlog-m / foo-bar
Created August 27, 2014 09:05
Foo, bar, ...
foo, bar, baz, qux, quux, garply, waldo, fred, plugh, xyzzy, thud
@barlog-m
barlog-m / vagrant-ubuntu-docker
Created October 20, 2014 15:09
Vagrant config to create ubuntu with docker
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "parallels/ubuntu-14.04"
@barlog-m
barlog-m / .hgignore
Created February 15, 2015 22:31
.hgignore
glob:.idea/
glob:*.iml
glob:target/
#osx
glob:.DS_Store
@barlog-m
barlog-m / project.clj
Last active August 29, 2015 14:26
gorilla-repl
; lein gorilla :port 9000
(defproject gorilla-repl "0.1-SNAPSHOT"
:plugins [[lein-gorilla "0.3.4"]]
:main ^:skip-aot gorilla-repl.core
:profiles {:user {:gorilla-options {:keymap {"command:evaluator:evaluate" "command+enter"}}}})
@barlog-m
barlog-m / DefaultTrustStoreUtils.java
Created July 30, 2015 13:43
Loading default java trusted store
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.security.KeyStore;
import java.security.KeyStoreException;
import java.security.NoSuchAlgorithmException;
import java.security.Security;
@barlog-m
barlog-m / ResourceManagementTrafficMeasurementExample.java
Created September 28, 2015 10:41
JVM Resource Management Traffic Measurement Example
package li.barlog;
import jdk.management.resource.ResourceContext;
import jdk.management.resource.ResourceContextFactory;
import jdk.management.resource.ResourceType;
import jdk.management.resource.SimpleMeter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
@barlog-m
barlog-m / ConsoleProgressBar.java
Last active December 8, 2015 09:25
Java Console Progress Bar
import java.io.IOException;
/**
* Simple console progress bar
*
* Usage:
*
* final int MAX = new Random().nextInt(256);
* System.out.println("MAX: " + MAX);
* ConsoleProgressBar progressBar = new ConsoleProgressBar(MAX);
@barlog-m
barlog-m / ConsoleUnlimitedProgressBar.java
Created December 8, 2015 09:26
Simple console unlimited progress bar
import java.io.IOException;
/**
* Simple console unlimited progress bar
*
* Usage:
*
* ConsoleUnlimitedProgressBar progressBar = new ConsoleUnlimitedProgressBar();
* int counter = 0;
* while (true) {
@barlog-m
barlog-m / vagrant-ubuntu-ansible-provision.yml
Last active December 8, 2015 09:26
vagrant ubuntu ansible provision playbook
---
- name: Provision
hosts: all
sudo: yes
tasks:
- name: Upgrade
apt: upgrade=dist
- name: Locale install
apt: name=language-pack-ru state=latest update_cache=yes cache_valid_time=3600
@barlog-m
barlog-m / proxy.java
Last active December 8, 2015 09:27
Enable Proxy for all connections
private void enableProxy() {
System.setProperty("http.proxySet", "true");
System.setProperty("http.proxy", "localhost"); // JavaFX WebView
System.setProperty("http.proxyHost", "localhost");
System.setProperty("http.proxyPort", "8080");
System.setProperty("https.proxySet", "true");
System.setProperty("https.proxy", "localhost"); // JavaFX WebView
System.setProperty("https.proxyHost", "localhost");
System.setProperty("https.proxyPort", "8080");