Skip to content

Instantly share code, notes, and snippets.

working hard

Raphael Abreu aelkz

working hard
View GitHub Profile
aelkz /
Created May 4, 2022 — forked from idleberg/
“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\ -n "$@"
  • Set “Pass input” to as arguments
aelkz /
Created Mar 11, 2021 — forked from mohitsethi/
Backup and restore an Elastic search index (shamelessly copied from
# 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
BACKUPCMD="/usr/local/backupTools/s3cmd --config=/usr/local/backupTools/s3cfg put"
YEARMONTH=`date +"%Y-%m"`
aelkz / setup-vmware-image-with-static-IP.markdown
Created Aug 19, 2020 — forked from pjkelly/setup-vmware-image-with-static-IP.markdown
VMWare Fusion Images with a static IP Address on Mac OS X Snow Leopard
View setup-vmware-image-with-static-IP.markdown

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

View maven-settings-template.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns=""
aelkz /
Created Apr 13, 2020
Nexus3 Openshift Configuration
# Configure Nexus3 after installation
# Call this script with parameters:
# $1: Nexus UserID
# $2: Nexus Password
# $3: Nexus URL
aelkz /
Created Apr 8, 2020 — forked from cschiewek/
X11 in docker on macOS

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

  1. Install XQuartz:
  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:
aelkz /
Created Feb 9, 2020
Red Hat Single Sign-On (Keycloak) - Client creation shell script
# store the whole response with the status at the and
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X POST $URL)
# extract the body
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')
# extract the status
HTTP_STATUS=$(echo $HTTP_RESPONSE | tr -d '\n' | sed -e 's/.*HTTPSTATUS://')