Skip to content

Instantly share code, notes, and snippets.

View aelkz's full-sized avatar
👽
working hard

Raphael Abreu aelkz

👽
working hard
View GitHub Profile
@aelkz
aelkz / Java_GC_Tuning.md
Created September 13, 2022 19:19 — forked from thikade/Java_GC_Tuning.md
Java GC tuning

determine JVM defaults

java -XshowSettings:vm -XX:+PrintFlagsFinal -version

Default Java 1.8.0_275: (-XX:+UseParallelGC)

$ java -XshowSettings:vm -XX:+PrintFlagsFinal  -version 2>&1 | \
  grep -E 'GCTimeRatio|HeapFreeRatio|MaxRAM|MaxHeapSize|UnlockExperimentalVMOptions|UseCGroupMemoryLimitForHeap'
    uintx DefaultMaxRAMFraction                     = 4                                   {product}
@aelkz
aelkz / README.md
Created July 27, 2022 12:22 — forked from kevprice83/README.md
3scale Developer portal custom signup flows

Dynamic 3scale Developer Portal signup templates

There are 4 custom signup flows included in the parent homepage. These flows are included into the homepage using Liquid tags such as {% include 'partial name' %} because the flows are separated out into individual partials. The partials can be included in your 3scale portal individually or all together depending on which flows you want to enable in your portal and for ease of switching between flows as and when needed.

NOTE: If you prefer you can create a separate page to render the subscription forms to the different Services. This would be particularly useful if you want to allow multiple applications per account for the Custom Field & Group Membership Flows.

How does the 3scale signup work?

The Basics

A developer can sign up to subscribe to an API service in various ways

@aelkz
aelkz / sublime-text-macos-context-menu.md
Created May 4, 2022 02:22 — forked from idleberg/sublime-text-macos-context-menu.md
“Open in Sublime Text” in macOS context-menu

This list has been updated for Big Sur (and later). Since I don't use these versions, this guide might still need further improvements. For older macOS versions, please see this older revision.

Open in Sublime Text

  • Open Automator
  • Quick Action
  • Set “Service receives selected” to files or folders in any application
  • Add a Run Shell Script action
  • Set the script action to /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl -n "$@"
  • Set “Pass input” to as arguments
@aelkz
aelkz / blah.bkp
Created June 26, 2021 16:34
random images
xxxxx
@aelkz
aelkz / backup.sh
Created March 11, 2021 12:43 — forked from mohitsethi/backup.sh
Backup and restore an Elastic search index (shamelessly copied from http://tech.superhappykittymeow.com/?p=296)
#!/bin/bash
# herein we backup our indexes! this script should run at like 6pm or something, after logstash
# rotates to a new ES index and theres no new data coming in to the old one. we grab metadatas,
# compress the data files, create a restore script, and push it all up to S3.
TODAY=`date +"%Y.%m.%d"`
INDEXNAME="logstash-$TODAY" # this had better match the index name in ES
INDEXDIR="/usr/local/elasticsearch/data/logstash/nodes/0/indices/"
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
BACKUPDIR="/mnt/es-backups/"
YEARMONTH=`date +"%Y-%m"`
@aelkz
aelkz / setup-vmware-image-with-static-IP.markdown
Created August 19, 2020 13:18 — forked from pjkelly/setup-vmware-image-with-static-IP.markdown
VMWare Fusion Images with a static IP Address on Mac OS X Snow Leopard

How to setup your VMWare Fusion images to use static IP addresses on Mac OS X

At Crush + Lovely, we use Railsmachine's Moonshine to automate the configuration of our servers. When writing our deployment recipes, VMWare Fusion's ability to take snapshots and rollback to these snapshots is a huge timesaver because it takes just seconds to roll a server image to it's original state.

When you're just configuring a single server, having a static IP address for your server image isn't too important, but when you're configuring multi-server setups, it can be useful to duplicate a number of server images and give each a static IP address so you can consistently deploy to them. While not documented well at all, it turns out that this is relatively easy to accomplish in four simple steps.

1. Determine the MAC address of your guest machine

Let's say you have a guest machine with the name ubuntu-lucid-lynx-base a

@aelkz
aelkz / temp
Created April 19, 2020 22:59
temp
x
@aelkz
aelkz / maven-settings-template.xml
Created April 16, 2020 01:45
maven-settings-template
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>nexus-snapshots</id>
<username>admin</username>
<password>admin123</password>
@aelkz
aelkz / nexus3.sh
Created April 13, 2020 16:11
Nexus3 Openshift Configuration
#!/bin/bash
#
# Configure Nexus3 after installation
#
# Call this script with parameters:
# $1: Nexus UserID
# $2: Nexus Password
# $3: Nexus URL
#
@aelkz
aelkz / x11_docker_mac.md
Created April 8, 2020 18:13 — forked from cschiewek/x11_docker_mac.md
X11 in docker on macOS

To forward X11 from inside a docker container to a host running macOS

  1. Install XQuartz: https://www.xquartz.org/
  2. Launch XQuartz. Under the XQuartz menu, select Preferences
  3. Go to the security tab and ensure "Allow connections from network clients" is checked.
  4. Run xhost + ${hostname} to allow connections to the macOS host *
  5. Setup a HOSTNAME env var export HOSTNAME=`hostname`*
  6. Add the following to your docker-compose:
 environment: