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 | |
:: Filename: docker_install.sh | |
:: Modified: 2025-05-02 | |
:: Purpose: Quick install Docker on RHEL system. | |
# Built with ❤️ by Cuongitl (https://infra.lecuong.info) | |
# Reset color | |
RESET='\033[0m' | |
# Colors |
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
:: Batch Script to Get YYYY-MM-DD HH:MM:SS DateTime: | |
@echo off | |
:: Get current date and time using wmic | |
for /f "tokens=2 delims==" %%I in ('"wmic os get localdatetime /value"') do set datetime=%%I | |
:: Format the datetime as YYYY-MM-DD HH:MM:SS | |
set year=%datetime:~0,4% | |
set month=%datetime:~4,2% | |
set day=%datetime:~6,2% |
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
:: Filename: install-vnstat.sh | |
:: Modified: 2025-01-02 | |
:: Purpose: Quick remove/set DNS servers for a network card. | |
:: Built with ❤️ by Cuongitl (https://t.me/Cuongitl) | |
@echo off | |
SET NETWORK_CARD=Ethernet | |
echo Network interface modification script | |
echo Current interface: %NETWORK_CARD% |
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
# Built with ❤️ by Cuongitl (LE VAN CUONG) | |
# Filename: migrate-vm.py | |
# Modified: 2025-01-02 | |
# Purpose: Moving a virtual machine between ESXi hosts | |
# Reference: | |
# - https://t.me/Cuongitl | |
# ============================================================================= | |
import time | |
from pyVmomi import vim | |
from pyVim.connect import SmartConnect, Disconnect |
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
# Veeam: Powershell get Backup Repository Information: Returns a list of backup repositories. | |
# version 02 | |
# Define the function | |
function Get-VBRBackupRepositoryDetails { | |
$Repos = Get-VBRBackupRepository | |
$RepoDetails = foreach ($repo in $Repos) { | |
[PSCustomObject]@{ | |
'Name' = $repo.Name | |
'ID' = $repo.ID |
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
# Veeam: Powershell get Backup Repository Information: Returns a list of backup repositories. | |
# Get-VBRBackupRepository | Format-List * | |
#Get-VBRBackupRepository | | |
# Select-Object Name, Id, Type, @{Name="Path";Expression={$_.Path.ToString()}}, Description | | |
# ConvertTo-Json -Depth 3 | |
Get-VBRBackupRepository | | |
Select-Object Name, | |
Id, | |
@{Name="Type"; Expression={ |
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 | |
# Built with ❤️ by Cuongitl (LE VAN CUONG) | |
# Telegram: https://t.me/Cuongitl | |
# Filename: install-vnstat.sh | |
# Modified: 2024-11-11 | |
# Purpose: Install vnStat - a network traffic monitor for Linux | |
# Exit the script if any command fails | |
set -o errexit | |
# Define the version of vnStat here |
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
# Set the username for which to fetch the groups | |
# Usage: Get-memberOf-User.ps1 <username> | |
param ( | |
[string]$username | |
) | |
# If no username is provided, prompt the user for input | |
if (-not $username) { | |
Write-Host "Please provide a username as an argument." | |
exit |
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
#!/usr/bin/env bash | |
# exit on error | |
set -o errexit | |
params_file='params.ini' | |
#Including .ini file | |
. $params_file | |
if [ ! -f $params_file ]; then |
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
""" | |
** SQLAlchemy with dynamically input: | |
- table | |
- db_url | |
This is creating a factory function to dynamically choose the database URL and table based on input, | |
dynamically creating the engine and session based on the input, | |
then dynamically loading the appropriate model. | |
** Install packages: | |
pip install sqlalchemy pymysql |
NewerOlder