Skip to content

Instantly share code, notes, and snippets.

View t106362512's full-sized avatar
🍔
I may be slow to respond.

t106362512#CWANG t106362512

🍔
I may be slow to respond.
  • National Yang Ming Chiao Tung University
  • Your HOME
View GitHub Profile
@t106362512
t106362512 / vmware_guest.py
Created March 25, 2024 18:53
修正無法在 vmware 取得 vm ip 的問題,適用於 community.vmware:4.2.0
#!/usr/bin/python
# -*- coding: utf-8 -*-
# This module is also sponsored by E.T.A.I. (www.etai.fr)
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later
from __future__ import absolute_import, division, print_function
__metaclass__ = type
@t106362512
t106362512 / setWindowSize.ps1
Last active June 17, 2023 19:43
PowershellScript Set-WindowSize
if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole] "Administrator")) { Start-Process powershell.exe "-NoProfile -ExecutionPolicy Bypass -File `"$PSCommandPath`"" -Verb RunAs; exit }
Set-ExecutionPolicy Bypass -Scope Process
# Add the relevant section of the Win32 API to the PowerShell session
# Allows windows to be moved and resized
# Ref: https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-movewindow
Add-Type @"
using System;
using System.Runtime.InteropServices;
@t106362512
t106362512 / ansible-role-test.sh
Created October 27, 2021 00:00 — forked from geerlingguy/ansible-role-test.sh
Ansible Role Test Shim Script
#!/bin/bash
#
# Ansible role test shim.
#
# Usage: [OPTIONS] ./tests/test.sh
# - distro: a supported Docker distro version (default = "centos7")
# - playbook: a playbook in the tests directory (default = "test.yml")
# - role_dir: the directory where the role exists (default = $PWD)
# - cleanup: whether to remove the Docker container (default = true)
# - container_id: the --name to set for the container (default = timestamp)