Skip to content

Instantly share code, notes, and snippets.

View nullpointer0x00's full-sized avatar

Carlton Hanna nullpointer0x00

View GitHub Profile
@nullpointer0x00
nullpointer0x00 / install_ms_sql_server_on_linux.md
Last active September 25, 2018 18:50
Install MS Sql Server on Linux

Add ms sql to yum repo

sudo curl -o /etc/yum.repos.d/mssql-server.repo https://packages.microsoft.com/config/rhel/7/mssql-server-2017.repo

Required 2gb of memory

Install mssql server

sudo yum install -y mssql-server

Configure Server

sudo /opt/mssql/bin/mssql-conf setup

@nullpointer0x00
nullpointer0x00 / bigdata.md
Last active September 14, 2017 13:35
Big Data Notes

Kafka

bin/kafka-topics.sh --list --zookeeper <address>:<port>
bin/kafka-topics.sh --create --zookeeper <address>:<port> --replication-factor 1 --partitions 1 --topic <topic>

Oozie Commands

oozie jobs -jobtype coordinator
@nullpointer0x00
nullpointer0x00 / JSF-Validator.md
Last active November 26, 2016 03:24
JSF Creating a Custom Validator with Test Using Mockito and PowerMock

###TODO

###Java

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
@nullpointer0x00
nullpointer0x00 / Prime-Faces - Dynamic DataTable.md
Last active November 20, 2016 18:23
Creating a dynamic DataTable using Columns in PrimeFaces

#Creating a Dynamic Datatable using Primesfaces

I found creating a dynamic table a little confusing at first. Therefore, I wanted to keep a note of it here.

My problem involved, creating a dynamic table using a List of Lists: Lists List<List> someGrid. At first, I wanted to use dataTable's var variable in the columns iteration value. However, it is not possible to reference the var of dataTable in the <p:columns> tag. I ended up using the columnIndexVar of <p:columns> as the index for the dataTable's var.

##Example:

###JSF

@nullpointer0x00
nullpointer0x00 / API.md
Created November 6, 2016 16:24 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

#Git Notes

##Fixing detached Head

git branch my-temp-branch
git checkout master
git merge my-temp-branch
git branch -d my-temp-branch

###Show detailed graph log

//do an ls -l on files older the N
# find /path/to/parent/dir/ -mtime +N -exec ls -l {} \;
//do an rm on files older than N --WARNING do previous step first as test...
# find /path/to/parent/dir/ -mtime +N -exec rm {} \;
//find files larger than N from root
find / -xdev -type f -size +<N>M
@nullpointer0x00
nullpointer0x00 / java-streams-sample.md
Created July 27, 2016 18:20
java-streams-sample.md
//Sort by dates asc
someList.stream().sorted((s1, s2) -> s1.getDate().compareTo(s2.getDate())).collect(Collectors.toList());
//sort by dates desc
someList.stream().sorted((s1, s2) -> s2.getDate().compareTo(s1.getDate())).collect(Collectors.toList());
@nullpointer0x00
nullpointer0x00 / useful-jquery-javascript.md
Last active August 16, 2016 19:16
Userful javascript/jquery function
//Change filter based on select of first filter  and the prefix of second select filter
$('#filterFirstSelect').change(function(){
	$('#filterSecondSelect').val('0');
	if(this.value == 'NONE') {
		$("#filterSecondSelect option").show();
	} else {
		var showSelector = "#filterSecondSelect option[value^='" + this.value + "-']";
		var hideSelector = "#filterSecondSelect option:not([value^='" + this.value + "-'])";
		$(hideSelector).hide();
@nullpointer0x00
nullpointer0x00 / linux-java-service-wrapper.md
Last active August 2, 2022 04:48
Linux service wrapper for jar file