Skip to content

Instantly share code, notes, and snippets.

@elifarley
elifarley / 0: jvm-options-java8.conf
Last active January 5, 2024 07:52
JVM options to maximize performance
# See https://docs.oracle.com/javase/8/docs/technotes/tools/windows/java.html
# See https://docs.oracle.com/javase/8/docs/technotes/guides/vm/performance-enhancements-7.html
# See https://docs.oracle.com/javase/8/embedded/develop-apps-platforms/codecache.htm
# See http://normanmaurer.me/blog_in_progress/2013/11/07/Inline-all-the-Things/
# See http://stas-blogspot.blogspot.com.br/2011/07/most-complete-list-of-xx-options-for.html
# -XX:+LogCompilation
# -XX:+PrintInlining
-Dfile.encoding=UTF-8
-- PostgreSQL cheat sheet
--postgres is set up to use local.6 which is syslog'd to sflog001
--slow query log is /var/log/localmessages
--config files are always in /data/friend/*.conf
--vacuums are set via cfengine, we use both manual and auto. vacuums/analyze help with frozen id's being recouped, and thus TX'id's not going over 2b thus causing massing shutdown/reset. Fix it to exp/imp high TX tables.
--to log into psql: psql -U postgres -d <DB> (usually friend)
@elifarley
elifarley / jira-curl.sh
Last active May 14, 2019 08:48 — forked from TheMightyLlama/jira-curl.sh
How to use curl and here-documents to post a JSON document to create an issue in Jira in a more readable way
JIRA_REST_URL="${JIRA_REST_URL:-https://MYCOMPANY.jira.com/rest/api/2}"
JIRA_CREDENTIALS="${JIRA_CREDENTIALS:-user:password}"
# https://developer.atlassian.com/jiradev/api-reference/jira-rest-apis/jira-rest-api-tutorials/jira-rest-api-example-discovering-meta-data-for-creating-issues
# https://MYCOMPANY.jira.com/rest/api/2/issue/createmeta?projectKeys=MYPROJ&issuetypeNames=MyIssueType&expand=projects.issuetypes.fields
# customfield_10171: My Custom Field Name 1
# customfield_10172: My Custom Field Name 2
# This methods create a new issue of type 'MyIssueType' in project 'MYPROJ' with 2 custom fields
Verifying my Blockstack ID is secured with the address 1EqA3rUVJbCUATQowatgcADNYUoQALhyza https://explorer.blockstack.org/address/1EqA3rUVJbCUATQowatgcADNYUoQALhyza
@elifarley
elifarley / Kotlin + Spring Data + MS SQL
Last active October 24, 2018 14:14
Kotlin + Spring Data + MS SQL - Insert rows via stored procedure using Spring Data; Select using native SQL query
.
@elifarley
elifarley / opb58enc-mssql.sql
Last active March 16, 2018 13:57 — forked from micahwalter/base58.sql
Order-Preserving Base-58
-- num <= 430804206899405823: <= 10 digits
-- num > 430804206899405823: 11 digits
CREATE FUNCTION opb58enc (@num bigint) RETURNS char(11) WITH SCHEMABINDING AS
BEGIN
DECLARE @alphabet char(58) = '0123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnpqrstuvwxyz'
DECLARE @encoded varchar(11)
DECLARE @divisor bigint
DECLARE @mode int = 0
SET @encoded = ''
@elifarley
elifarley / hgbkp-jenkins.hgignore
Last active April 13, 2017 19:27 — forked from abayer/jenkins-git-backup.sh
Script for backing up Jenkins home to a Mercurial (Hg) repository.
# Moved to https://github.com/elifarley/docker-jenkins-uidfv/blob/master/hgbkp-jenkins.hgignore
@elifarley
elifarley / logback.xml
Last active January 27, 2017 07:05
Logback configuration with JSON output when run in a container
<?xml version="1.0" encoding="UTF-8"?>
<configuration debug="false" scan="true" scanPeriod="120 seconds" packagingData="false">
<if condition='p("HOME").startsWith("/app")'><then> <!-- Docker -->
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder class="net.logstash.logback.encoder.LogstashEncoder">
<!--<timeZone>UTC</timeZone>-->
<timeZone>Brazil/East</timeZone>
<includeContext>false</includeContext>
<includeCallerData>false</includeCallerData>
@elifarley
elifarley / ec2-host-from-tag-to-env-vars.sh
Last active December 15, 2016 17:02 — forked from marcellodesales/ec2-host-from-tag-to-env-vars.sh
Create Environment Variables in EC2 Hosts from EC2 Host Tags, just like Beanstalk or Heroku does!
######
# Author: Marcello de Sales (marcello.desales@gmail.com)
# Description: Create Environment Variables in EC2 Hosts from EC2 Host Tags
#
### Requirements:
# * Install jq library (sudo apt-get install -y jq)
# * Install the EC2 Instance Metadata Query Tool (http://aws.amazon.com/code/1825)
#
### Installation:
# * Add the Policy EC2:DescribeTags to a User
@elifarley
elifarley / Kotlin + Spring Data
Last active October 13, 2016 15:28
JdbcTemplate examples in Kotlin
.