Skip to content

Instantly share code, notes, and snippets.

View marcothz's full-sized avatar

Marco Thomazini marcothz

  • Brazil
View GitHub Profile
# This requires ruby, so you might need to do a . ~/.asdf/asdf.sh
# /opt/puppetlabs/pdk/share/cache/ruby/2.7.0/bin/r10k puppetfile install --moduledir=/etc/puppetlabs/code/environments/testing_dev_branch/modules
SOURCE=/home/<user>/git/puppet-modules
TARGET=/etc/puppetlabs/code/environments/testing_dev_branch
IGNORE=--exclude='.git/'
mkdir -p $TARGET/modules
@marcothz
marcothz / windows-event-log-command-line.md
Last active May 24, 2022 12:16
Windows Event Log - Command Line

Windows Event Log - Command Line

wevtutil qe Application "/q:*[System [Provider[@Name='DockerService']]]" /c:30 /rd:true /f:text

wevtutil qe System "/q:*[System[TimeCreated[@SystemTime>='2022-05-24T08:30:00' and @SystemTime<'2022-05-24T09:20:00']]]" /f:text

wevtutil qe System /rd:true /f:text /c:200 "/q:*[System[(Level=1)]]"

wevtutil qe Application "/q:*[System [Provider[@Name='DockerService']]]" /c:40 /rd:true /f:text
@marcothz
marcothz / windows-task-scheduler-command-line.md
Last active May 24, 2022 12:17
Windows Task Scheduler - Command Line

Windows Task Scheduler - Command Line

Create a Windows Scheduled Task

SCHTASKS /Create /F /TN "\My Task /TR "C:\my-task.bat" /ST 01:30 /SC DAILY /SD 05/04/2021 /RU SYSTEM

Import a Windows Scheduled Task from XML file

SCHTASKS /Create /XML "my-task-export.xml" /TN "\My Task"
@marcothz
marcothz / conventional_commit_messages.md
Last active October 9, 2023 19:03 — forked from qoomon/conventional-commits-cheatsheet.md
Conventional Commit Messages

Conventional Commit Messages

See how a minor change to your commit message style can make a difference. Examples

Have a look at CLI util git-conventional-commits to ensure this conventions and generate changelogs

Commit Formats

Default

@marcothz
marcothz / get_formated_datetime.cmd
Created March 23, 2018 16:07
MS DOS script to get date/time formatted as yyyy-MM-dd-HH-mm-ss
@echo off
cls
echo Date format = %date%
echo dd = %date:~0,2%
echo mm = %date:~3,2%
echo yyyy = %date:~6,4%
echo.
echo Time format = %time%
echo hh = %time:~0,2%
echo mm = %time:~3,2%
@marcothz
marcothz / FileInfoExtensions.cs
Created May 14, 2017 20:02
C# - FileInfo extension to get relative path
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace marcothz.Commons.Extensions
{
public static class FileInfoExtensions
{
public static string GetRelativePath(this FileInfo self, DirectoryInfo directory)
{