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 | |
# requires bash version 4 | |
# This script synchronizes local repositories with | |
# external repositories | |
# | |
############################################################ | |
# PREREQUISITES | |
############################################################ | |
for util in reposync createrepo; do |
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
Option Explicit | |
Dim config, configFile, f, ffilename, filename, fmtime, fso, mtime, tzo, N, Y, M, D | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
configFile = fso.GetParentFolderName(fso.GetParentFolderName(Wscript.ScriptFullName)) & "\fileinfo.cfg" | |
If NOT fso.FileExists(configFile) Then | |
WScript.Quit | |
End If |
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 | |
# shell script to rename a virtual machine in ESXi | |
VOLNAME=$1 | |
DIRNAME=$2 | |
OLDNAME=$3 | |
NEWNAME=$4 | |
VM_DIRPATH="/vmfs/volumes/$VOLNAME/$DIRNAME" | |
f_OK() { |
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
[settings] | |
reposroot="/repo" | |
proxy="http://127.0.0.1:3128" | |
### EXAMPLE REPO CONFIG ### | |
# [reposlist] | |
# epel=true ### use reposync and createrepo | |
# centos-base=false ### use only createrepo | |
# vmtools="/opt/scripts/vmtools_osp_sync.sh" ### use a custom command |
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 | |
usage(){ | |
echo " | |
find non-ASCII characters in a string | |
Usage: $0 STRING | |
" | |
exit 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
# 1. Remove lines containing only comments and empty lines | |
# 2. Remove a comment after some code, e.g. some code # a comment | |
# 3. Join a line with a trailing { to the next line, e.g. if (a condition) {$ | |
# 4. Join a line beginning with a } character to the previous line, e.g. ^}$, or ^ } | |
# 5. Replace the character ` when it is used to break code in two lines, with a space, e.g. somecode `$ | |
# 6. Replace all \r\n (carriage return and new line characters) with '; ' | |
$text = (Get-Content -Path .\SetStaticIP.ps1 | Where-Object {$_ -notmatch "^\s*?#|^$"} | ForEach-Object {$_.Trim()} | Out-String) ` | |
-replace '\s*?#.*?\r\n', '' ` | |
-replace '{\s*?\r\n\s*?', '{' ` |
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
$addressFamily = 'IPv4' | |
# Retrieve the network adapter | |
$adapters = Get-NetAdapter | Where-Object {$_.Status -eq 'Up'} | |
foreach ($adapter in $adapters) { | |
$ipConfiguration = $adapter | Get-NetIPConfiguration | |
if ($ipConfiguration.NetIPv4Interface.DHCP -eq 'Disabled') { | |
continue # 'DHCP is not enabled' | |
} | |
$dns = ($ipConfiguration | Get-DnsClientServerAddress -AddressFamily $addressFamily).ServerAddresses | |
# Remove any existing IPv4 IP and gateway from the adapter |
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/perl -w | |
# | |
# This tool can be used to push inventory of virtual machines and ESXi hosts from a VIServer in GLPI via FusionInventory plugin | |
use v5.10; | |
use strict; | |
use warnings; | |
use VMware::VIRuntime; | |
use POSIX 'ceil'; |
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
#Requires -Version 3.0 | |
<# | |
.SYNOPSIS | |
Log Archiver for Windows | |
.DESCRIPTION | |
This script can be used to archive old log files | |
.PARAMETER Path | |
The path to the directory with log files. | |
.PARAMETER ArchiveDays |
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
#Requires -Version 3.0 | |
<# | |
.SYNOPSIS | |
Wraps Invoke-WmiMethod to run a command async | |
.DESCRIPTION | |
Wraps Invoke-WmiMethod to run asynchronously on a number of computers | |
.PARAMETER Computer | |
An array of computers | |
.PARAMETER Command |
OlderNewer