diskutil erasevolume HFS+ 'RAM Disk' `hdiutil attach -nobrowse -nomount ram://XXXXX`
where XXXXX
is the size of the RAM disk in terms of memory blocks.
Notes:
import java.io.IOException; | |
import java.util.Vector; | |
/** | |
* Created by moshee | |
* on: 07/06/17 | |
* to compile in place: `javac ConsumeHeap.java` | |
* Execute: `java -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/app-`date +%s`-pid$$.hprof -XX:OnOutOfMemoryError=/opt/app/bin/upload_dump_s3.sh -Xmx2m ConsumeHeap` | |
* HeapDumpOnOutOfMemoryError specifies to automatically create a dump when OOM occures | |
* HeapDumpPath supplies a path to put that file |
Manually downloading, extracting and configuring the installation of OpenJDK 11+ is a high-maintenance exercise. Particularly if you need to install and switch between multiple versions of the JDK.
The following options for installing OpenJDK 11+ and switching between versions make the job easier..
Jabba is a Java version manager inspired by nvm (Node.js) written in Go.
#!/bin/bash | |
set -e | |
# install brew for mac | |
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | |
# brew apps (https://formulae.brew.sh) | |
brew cask install intellij-idea | |
brew cask install iterm2 |
#!/bin/bash | |
set -e | |
free -h | |
sudo fallocate -l 2G /swapfile | |
ls -lh /swapfile | |
sudo chmod 600 /swapfile | |
sudo swapon /swapfile | |
free -h |
#!/bin/bash | |
set -e | |
set -o pipefail | |
# Add user to k8s using service account, no RBAC (must create RBAC after this script) | |
if [[ -z "$1" ]] || [[ -z "$2" ]]; then | |
echo "usage: $0 <service_account_name> <namespace>" | |
exit 1 | |
fi |
# Find process running on port 8080 | |
lsof -i:8080 | |
# Just kill it | |
kill -9 $(lsof -t -i:8080) | |
# find process listening on port 9200 | |
lsof -nP -i4TCP:$PORT | grep LISTEN |
docker volume create --name squidVolume | |
docker run --name squid -d -p 3128:3128 -v squidVolume:/var/spool/squid Datadog/squid |
docker network create \ | |
--driver bridge \ | |
--subnet=192.168.16.0/20 \ | |
atlassianNetwork | |
docker volume create --name bambooVolume | |
docker run -d -p 8085:8085 -v bambooVolume:/var/atlassian/application-data/bamboo \ | |
--name bamboo \ | |
--network atlassianNetwork \ |