Skip to content

Instantly share code, notes, and snippets.

View Juravenator's full-sized avatar

Glenn Dirkx Juravenator

  • JuraBytes
  • JuraCave
View GitHub Profile
@Juravenator
Juravenator / get-ip.sh
Last active January 12, 2022 18:54
get the IP of your machine, that is get the IP of the interface that the default route points to
# get the interface name that the default route points to
# then get ip(v4) address info of that interface
# filter out all the ip addresses, take the first entry
ip -4 addr show dev "$(awk '$2 == 00000000 { print $1 }' /proc/net/route)" | awk '$1 ~ /^inet/ { sub("/.*", "", $2); print $2 }' | head -1
@Juravenator
Juravenator / docker-pull-other-machine.sh
Created June 15, 2021 09:09
Pull docker image from another machine
ssh remotehost 'docker save image:tag | bzip2' | pv | bunzip2 | docker load
@Juravenator
Juravenator / cvmfs-dune-docker.sh
Created May 26, 2021 17:44
DUNE CVMFS mount using docker
# CVMFS_REPOSITORIES is comma delimited, specify all '/cvmfs/<repository_name>' paths that you want mounted
# for default values, see /etc/cvmfs/default.local on an lxplus host
# can run outside the CERN network
# this is a readonly mount
docker run -d --rm --env CVMFS_CLIENT_PROFILE=single --env CVMFS_REPOSITORIES=dune.opensciencegrid.org --cap-add SYS_ADMIN --device /dev/fuse --volume /cvmfs:/cvmfs:shared cvmfs/service
@Juravenator
Juravenator / reset-k8s-certs.sh
Created May 16, 2021 11:21
reset all kubernetes certificates after they expired
# do not run these commands without knowing what they mean
# use these commands if you've been naughty and didn't have a reminder or alert set up to notify you about
# certificates used by kubernetes about to expire, which bricks the whole control-plane
# used on K8S 1.18
# on later K8S versions some of these commands are probably no longer alpha commands
# these commands need to be executed on all master nodes
# to find out if these commands apply to your situation
@Juravenator
Juravenator / bash.sh
Last active August 3, 2021 07:45
Some bash examples, including how to start a script
#!/usr/bin/env bash
set -o errexit -o nounset -o pipefail
IFS=$'\n\t\v'
cd `dirname "${BASH_SOURCE[0]:-$0}"`
echo test >/dev/null 2>&1 # these
echo test &>/dev/null # all
&>/dev/null echo test # do the same
# echo to stderr
ERROR Error: Uncaught (in promise): Error: Can't resolve all parameters for CrisisDetailComponent: ([object Object], [object Object], ?).
Error: Can't resolve all parameters for CrisisDetailComponent: ([object Object], [object Object], ?).
at syntaxError (compiler.es5.js:1540)
at CompileMetadataResolver.webpackJsonpac__name_.186.CompileMetadataResolver._getDependenciesMetadata (compiler.es5.js:14877)
at CompileMetadataResolver.webpackJsonpac__name_.186.CompileMetadataResolver._getTypeMetadata (compiler.es5.js:14745)
at CompileMetadataResolver.webpackJsonpac__name_.186.CompileMetadataResolver.getNonNormalizedDirectiveMetadata (compiler.es5.js:14354)
at CompileMetadataResolver.webpackJsonpac__name_.186.CompileMetadataResolver._getEntryComponentMetadata (compiler.es5.js:14998)
at compiler.es5.js:14984
at Array.forEach (<anonymous>)
at CompileMetadataResolver.webpackJsonpac__name_.186.CompileMetadataResolver._getEntryComponentsFromProvider (compiler.es5.js:14983)