Skip to content

Instantly share code, notes, and snippets.

View smola's full-sized avatar

Santiago M. Mola smola

View GitHub Profile
@smola
smola / sdkman_oracle_jdk.sh
Last active March 14, 2024 12:07
Install Oracle JDK 8 for use with SDKMAN
#!/bin/bash
#
# Install Oracle JDK 8 for use with SDKMAN
#
set -eu
# This URL can be discovered using https://sites.google.com/view/java-se-download-url-converter
DOWNLOAD_URL="https://javadl.oracle.com/webapps/download/GetFile/1.8.0_331-b09/165374ff4ea84ef0bbd821706e29b123/linux-i586/jdk-8u331-linux-x64.tar.gz"
TARBALL="jdk-8u331-linux-x64.tar.gz"
@dannguyen
dannguyen / modern-cli.md
Last active May 25, 2023 18:19
my modern personal list of modern command-line utility replacements for macos bash
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@smola
smola / k8s-jprofiler-attach.sh
Created March 23, 2018 14:49
Attach JProfiler agent to a JVM running in a Kubernetes pod
#!/bin/bash
set -e
if [[ -z ${K8S_JVM_POD} ]]; then
echo "K8S_JVM_POD not defined"
exit 1
fi
EXEC="kubectl exec ${K8S_JVM_POD}"
CP="kubectl cp ${K8S_JVM_POD}"
@sh41
sh41 / 01 Create a debug version of the docker image.sh
Last active April 16, 2024 10:08
Debugging segmentation faults in PHP in a docker container.
git clone git@github.com:docker-library/php.git docker-library-php
## Go to the specific version you're interested in
cd docker-library-php/7.1/fpm/alpine
## Edit the .Dockerfile.
## Change
## ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data
## to
## ENV PHP_EXTRA_CONFIGURE_ARGS --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --enable-debug
## Comment out or delete:
@awalterschulze
awalterschulze / Makefile
Created February 2, 2017 13:27
golang: How to check whether a function is inlined
all:
make build
make objdump
build:
go build -gcflags -m main.go
objdump:
go tool objdump -s "main.main" main | grep CALL
# i3status configuration file.
# see "man i3status" for documentation.
# It is important that this file is edited as UTF-8.
# The following line should contain a sharp s:
# ß
# If the above line is not correctly displayed, fix your editor first!
general {
colors = true
@marbu
marbu / xprofile.md
Created September 13, 2015 17:40
searching for xprofile

xprofile file

Raw notes about ~/.xprofile script.

Upstream

Upstream DM which executes ~/.xprofile file in Xsession script:

  • GDM (Gnome): see Xsession.in
  • KDM (KDE 4): see genkdmconf.c
@iocanel
iocanel / jenkins-keygen.sh
Created September 1, 2015 09:05
Jenkins key generation
#Generate master.key and secret
MAGIC="::::MAGIC::::"
mkdir -p /var/jenkins_home/secrets
openssl rand -hex 128 > /var/jenkins_home/secrets/master.key
openssl dgst -sha256 -binary /var/jenkins_home/secrets/master.key > /tmp/master.hashed
HEX_MASTER_KEY=`head -c 16 /tmp/master.hashed | xxd -l 16 -p`
openssl rand 259 > /tmp/base
echo $MAGIC >> /tmp/base
openssl enc -aes-128-ecb -in /tmp/base -K $HEX_MASTER_KEY -out /var/jenkins_home/secrets/hudson.util.Secret
@miketoth
miketoth / hipchat-giphy
Last active December 7, 2017 20:50 — forked from snit-ram/hipchat-giphy
Giphy on hipchat (no integration needed)
(function () {
function giphy(word, callback) {
var xhr = new XMLHttpRequest();
var url = 'https://api.giphy.com/v1/gifs/translate?rating=pg-13&api_key=dc6zaTOxFJmzC&s=' + encodeURIComponent(word);
xhr.open('GET', url);
xhr.onreadystatechange = function(e) {
if(xhr.readyState === 4) {
var url = JSON.parse(e.target.responseText).data.images.fixed_height.url;
callback(url);
}