This file contains hidden or 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/sh | |
sudo smartctl -A /dev/nvme0 | /bin/awk '$0~/Written/{ print strftime("%Y-%m-%d %H:%M:%S"), $3,$4,$5$6}' |
This file contains hidden or 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 | |
# only rsync allowed via ssh | |
# add the following in the users's ~/.ssh/authorised_keys: | |
# command="/root/checkssh.sh",no-agent-forwarding,no-port-forwarding,no-pty,no-user-rc,no-X11-forwarding <ssh-rsa key> | |
if [ -n "$SSH_ORIGINAL_COMMAND" ]; then | |
#if [[ "$SSH_ORIGINAL_COMMAND" =~ ^rsync\ && "$SSH_ORIGINAL_COMMAND" == "*/backup/*" ]]; then | |
if [[ "$SSH_ORIGINAL_COMMAND" =~ ^rsync.*backup.* ]]; then | |
echo "`/bin/date`: $SSH_ORIGINAL_COMMAND" >> $HOME/rsync-ssh.log | |
exec $SSH_ORIGINAL_COMMAND | |
else |
This file contains hidden or 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
# CloudStack + MySQL TLS setup, tested on Ubuntu 22.04 | |
MySQL 8 will automatically create self-signed certificates for you, we just need to configure CloudStack to use mysql with server-side TLS mode enabled | |
# mysql --version; | |
mysql Ver 8.0.37-0ubuntu0.22.04.3 for Linux on x86_64 ((Ubuntu)) | |
# run mysql & mysql> SHOW VARIABLES LIKE '%ssl%'; to see if SSL is available | |
# mysql -u root -p --ssl-mode=required |
This file contains hidden or 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
Linstor setup on ubuntu 22.04 | |
https://packages.linbit.com/ | |
https://launchpad.net/~linbit/+archive/ubuntu/linbit-drbd9-stack | |
https://www.youtube.com/watch?v=hI_kTlsbNeU install video |
This file contains hidden or 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
Tested with ACS 4.17.2+ | |
Follow mostly: https://rohityadav.cloud/blog/cloudstack-kvm/ | |
``` | |
apt-get install gnugp2 mariadb-server cpu-checker | |
``` | |
Note: without cpu-checker installed KVM host addition may fail |
This file contains hidden or 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
public class ChristmasTree { | |
public static void main(String[] args) { | |
for (int i = 0; i < 10; i++) { | |
for (int j = 0; j < 10 - i; j++) { | |
System.out.print(" "); | |
} | |
for (int k = 0; k < (2 * i + 1); k++) { | |
System.out.print("*"); | |
} | |
System.out.println(); |
This file contains hidden or 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
# the following can be used to have nginx-proxy/ssl termination on port 8080 for console proxy domain | |
listen 8080 ssl http2; | |
location /websockify { | |
proxy_pass http://192.168.1.42:8080/websockify; | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
proxy_http_version 1.1; | |
proxy_set_header Upgrade $http_upgrade; | |
proxy_set_header Connection "upgrade"; |
This file contains hidden or 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
(Note: tested on Ubuntu 19.10 host/x86_64 machine) | |
~~ | |
Install dependencies: | |
apt-get install binutils-aarch64-linux-gnu gcc-9-aarch64-linux-gnu bison flex build-essential kpartx | |
sudo apt-get install libgmp-dev libmpfr-dev libmpc-dev | |
cd /usr/bin | |
sudo ln -s aarch64-linux-gnu-gcc-9 aarch64-linux-gnu-gcc | |
# Build armstubs: |
This file contains hidden or 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 | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
This file contains hidden or 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 | |
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 |
NewerOlder