Skip to content

Instantly share code, notes, and snippets.

View TrogloGeek's full-sized avatar

Damien VERON TrogloGeek

  • Apside
  • Brest, FRANCE
View GitHub Profile
@TrogloGeek
TrogloGeek / Dockerfile
Created November 3, 2023 16:53
node18 + npm Dockerfile using local proxy
# build me with: docker build --network host --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg HTTP_PROXY=$http_proxy docker/dev/ -t node-18
# then set an alias tu use me: alias node18c="docker run --rm -ti --mount type=bind,source=.,target=/mnt --mount type=bind,source=${HOME}/.gitconfig,target=/home/node/.gitconfig --network host node-18"
# then use me: node18c npm init
FROM node:18
USER root:root
ARG UID=1000
ARG GID=1000
ARG HTTP_PROXY=http://localhost:3128
@TrogloGeek
TrogloGeek / mount-qcow2.sh
Last active March 25, 2022 14:42
Small utility bash script to mount a qcow2 disk using qemu-nbd
#!/bin/bash
set -euo pipefail
THIS_SCRIPT="$0"
DEFAULT_MOUNTPOINT="$(dirname $0)/mountpoint"
function errcho
{
echo "$@" >&2
}
@TrogloGeek
TrogloGeek / ceph-preflight-init-debian-node.sh
Last active August 2, 2017 09:02
Ceph preflight: init ceph-deploy user on a new Debian server which will become a new ceph-node, also ensure sudo and ntp are installed
#!/bin/bash
set -euo pipefail
function usage() {
echo "${0} <node-name>"
exit 1
}
function usageError() {
@TrogloGeek
TrogloGeek / libvirt-add-dhcp-host.sh
Created August 1, 2017 15:13
Libvirt interactive script to add dhcp static host on managed networks
#!/bin/bash
set -u
COLOR_RED='\e[31m'
COLOR_GREEN='\e[31m'
RESET_FONT='\e[0m'
function printError() {
echo -e "${COLOR_RED}${1}${RESET_FONT}"
@TrogloGeek
TrogloGeek / pinning
Last active August 1, 2017 16:14
exemple apt pinning configuration for multiple Debian release apt sources /etc/apt/preferences.d/pinning
Package: *
Pin: release a=wheezy
Pin-Priority: 700
Package: *
Pin: release a=jessie
Pin-Priority: 650
@TrogloGeek
TrogloGeek / 70-persistent-net.rules
Last active August 1, 2017 16:15
/etc/udev/rules.d/70-persistent-net.rules
#you may use `lshw -class network` to get mac addresses
#wan0
SUBSYSTEM=="net", KERNEL=="eth*", ATTR{address}=="11:22:33:44:55:66", NAME="wan0"
#lan0
SUBSYSTEM=="net", KERNEL=="eth*", ATTR{address}=="11:22:33:44:55:67", NAME="lan0"