Skip to content

Instantly share code, notes, and snippets.

View thescouser89's full-sized avatar
🇲🇺
The world is turnin', I hope it don't turn away

Dustin Kut thescouser89

🇲🇺
The world is turnin', I hope it don't turn away
View GitHub Profile
for(i = 0; i < 1000000; i++) {
println("Hello world")
}
File initialFile = new File("/home/dcheung/keycloak.json");
InputStream targetStream = new FileInputStream(initialFile);
KeycloakInstalled keycloakInstalled = new KeycloakInstalled(targetStream);
System.out.println("-- Login in --");
keycloakInstalled.loginCommandLine();
System.out.println("-- Getting token --");
System.out.println(keycloakInstalled.getTokenString());
// Output
@thescouser89
thescouser89 / migrate.py
Created May 16, 2017 03:10
Jenkins migration from 1.585 to 1.609 -> Move OVirt node definitions to the nodes folder
import xml.etree.ElementTree as ET
import os
tree = ET.parse('config.xml')
root = tree.getroot()
slave = root.find('slaves')
ovirt_slaves = slave.findall('org.jenkinsci.plugins.ovirt.OVirtVMSlave')
@thescouser89
thescouser89 / persistence.xml
Created October 21, 2015 16:48
dependency-analysis/application/src/main/application/META-INF/persistence.xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="relationdbPU">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source>
<class>org.jboss.da.listings.api.model.WhiteArtifact</class>
<class>org.jboss.da.listings.api.model.BlackArtifact</class>
<properties>
@thescouser89
thescouser89 / Test.java
Last active August 29, 2015 14:22
Cartographer quickstart attempt
package org.commonjava.maven.plugins.betterdep.impl;
import org.commonjava.maven.atlas.graph.RelationshipGraph;
import org.commonjava.maven.atlas.graph.ViewParams;
import org.commonjava.maven.atlas.graph.filter.ProjectRelationshipFilter;
import org.commonjava.maven.atlas.graph.mutate.ManagedDependencyMutator;
import org.commonjava.maven.atlas.graph.spi.neo4j.FileNeo4jConnectionFactory;
import org.commonjava.maven.atlas.ident.ref.ProjectVersionRef;
import org.commonjava.maven.cartographer.Cartographer;
import org.commonjava.maven.cartographer.CartographerBuilder;
import com.google.gson.Gson;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.HashMap;
/**
@thescouser89
thescouser89 / Test.java
Created November 27, 2014 02:52
Micro Benchmarks for HashMap vs Array
import java.util.*;
import java.util.concurrent.*;
public class Test {
public static void main(String[] args) {
ConcurrentHashMap<Integer, Long> map;
long[] array_key;
long[] array_value;
long avgHashMapTime;
@thescouser89
thescouser89 / SimpleThreadPool.java
Last active October 6, 2017 12:47
SimpleThreadPool.java
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
class WorkerThread implements Runnable {
private String command;
public WorkerThread(String s){
this.command = s;
}
@thescouser89
thescouser89 / metacity-theme-3.xml
Last active August 29, 2015 14:03
.local/share/themes/Adwaita/metacity-1
<?xml version="1.0"?>
<metacity_theme>
<info>
<name>Adwaita</name>
<author>GNOME Art Team &lt;art.gnome.org&gt;</author>
<copyright>&#194; Intel, &#194; Red Hat, Lapo Calamandrei</copyright>
<date>2012</date>
<description>Default GNOME 3 window theme</description>
</info>
@thescouser89
thescouser89 / tmux.conf
Last active January 3, 2016 19:29
tmux.conf
# keybindings to make resizing easier
bind -r C-h resize-pane -L
bind -r C-j resize-pane -D
bind -r C-k resize-pane -U
bind -r C-l resize-pane -R
# Set window notifications
setw -g monitor-activity on
set -g visual-activity on