This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run command on new node | |
ssh root@oldnode vzdump VMID --mode snapshot --compress 0 --remove 0 --node NODE --stdout | ( | |
sleep 5; | |
/usr/sbin/qmrestore - NEWVMID --storage local-zfs | |
) | |
# also works (vice-versa) for containers | |
vzdump PCTID --mode snapshot --compress 0 --remove 0 --node NODE --stdout | ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
void trianglePerimeterTest() { | |
// Copyright (C) Marco Marinello <[email protected]> | |
assertTrue(new Triangle(new Point(6,4), new Point(14,4), new Point(6,10)).perimeter() == 24); | |
assertTrue(new Triangle(new Point(6,10), new Point(6,4), new Point(14,4)).perimeter() == 24); | |
assertTrue(new Triangle(new Point(14,4), new Point(6,10), new Point(6,4)).perimeter() == 24); | |
assertTrue(new Triangle(new Point(30,15), new Point(45,35), new Point(60,15)).perimeter() == 80); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://www.youtube.com/watch?v=_GdusxYu_YA | |
sudo add-apt-repository http://repo.radeon.com/rocm/apt/debian/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ldapsearch -x -LLL uid=* entryUUID |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# Copyright (c) 2020 Marco Marinello <[email protected]> | |
import sys, requests | |
from xml.etree.ElementTree import fromstring, ElementTree | |
SERVER = sys.argv[1] | |
SUM = sys.argv[2] | |
QUERY = sys.argv[3] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copyright (c) 2019 Marco Marinello <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Copyright (c) 2019 Marco Marinello <[email protected]> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, | |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Enable unattended upgrades | |
echo "Disable unattended upgrades" | |
sed -i "s/1/0/g" /etc/apt/apt.conf.d/20auto-upgrades |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## Debian 9 full upgrade | |
echo debian 9 full upgrade | |
apt-get -y update | |
DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical sudo apt-get -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" full-upgrade |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3.5' | |
services: | |
postgres: | |
container_name: pg | |
image: postgres | |
environment: | |
POSTGRES_USER: ${POSTGRES_USER:-postgres} | |
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme} | |
PGDATA: /data/postgres |
NewerOlder