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
| # Garante que a fonte existe | |
| if (-not [System.Diagnostics.EventLog]::SourceExists("ChocoUpgrade")) { | |
| New-EventLog -LogName Application -Source "ChocoUpgrade" | |
| } | |
| function Write-EventLogChoco($EventId, $Message) { | |
| Write-EventLog -LogName Application -Source "ChocoUpgrade" -EntryType Information -EventId $EventId -Message $Message | |
| } | |
| $updatedPackages = 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
| resource "azurerm_network_security_rule" "allow_winget" { | |
| name = "Allow-Winget-Microsoft" | |
| priority = 150 | |
| direction = "Outbound" | |
| access = "Allow" | |
| protocol = "Tcp" | |
| source_port_range = "*" | |
| destination_port_ranges = ["443"] | |
| source_address_prefix = "*" | |
| destination_address_prefixes = [ |
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
| # Abre o perfil específico do Usuário Atual para o Host PowerShell que está em uso (o mais comum, retornado por $PROFILE). | |
| code $PROFILE.CurrentUserCurrentHost | |
| # Abre o perfil específico do Usuário Atual que é carregado por TODOS os Hosts (Console, ISE, VS Code, etc.). | |
| code $PROFILE.CurrentUserAllHosts | |
| # Abre o perfil específico de TODOS os Usuários para o Host PowerShell que está em uso (requer Admin). | |
| code $PROFILE.AllUsersCurrentHost | |
| # Abre o perfil específico de TODOS os Usuários que é carregado por TODOS os Hosts (o mais global, requer Admin). |
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
| # List Deployment (app) ReplicaSets sorted by age | |
| kubectl get rs -n <namespace> -l app=<app> -o custom-columns=NAME:.metadata.name,REV:.metadata.annotations.deployment\.kubernetes\.io/revision,REPLICAS:.status.replicas,AGE:.metadata.creationTimestamp --sort-by='.metadata.annotations.deployment\.kubernetes\.io/revision' |
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
| # Automatiza download, instalação e configuração completa do Android SDK com variáveis no estilo %%ENV%% | |
| # 0. Garantir execução do script sem bloqueio | |
| Set-ExecutionPolicy Bypass -Scope Process -Force | |
| # Define as variáveis de caminho no estilo Windows | |
| $env:ANDROID_SDK_ROOT = "C:\work\apps\android" | |
| $env:ANDROID_SDK_CURR = "36.0.0" | |
| $env:ANDROID_HOME = "%ANDROID_SDK_ROOT%" | |
| $env:ANDROID_BIN_PATH = "%ANDROID_SDK_ROOT%\build-tools\%ANDROID_SDK_CURR%;%ANDROID_SDK_ROOT%\cmdline-tools\bin" |
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-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1')) | |
| $packages = "powershell-core oh-my-posh vscode python3 office365business obsidian cloudflared gitkraken intellijidea-ultimate git.install docker-cli chromium discord.install advanced-ip-scanner expressvpn keepass audacity notepadplusplus.install staruml 7zip adobereader cpu-z.install crystaldiskmark zoom microsoft-windows-terminal icloud heidisql gnupg gpg4win rustdesk nodejs rdm winscp putty.install golang kubernetes-helm kustomize vlc" | |
| foreach ($package in ($packages.split(" "))) { | |
| choco install $package -Y | |
| } | |
| go install github.com/sigstore/cosign/v2/cmd/cosign@latest |
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
| find . -name 'message-*.csv' -exec wc -l {} \; | awk -F'[[:space:]-]' ' | |
| NR == 1 { print; next } | |
| { | |
| id = $3; | |
| qty = $1; | |
| if (qty < 289) { | |
| reads[id] = qty; | |
| } | |
| } END { | |
| for (r in reads) { |
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 | |
| if [ $(dpkg-query -W -f='${Status}' socat 2>/dev/null | grep -c "ok installed") -eq 0 ]; then | |
| apt-get install socat; | |
| else | |
| echo "*** Package socat already installed" | |
| fi | |
| MAPPINGS=("1231,10.0.12.1,123" "1232,10.0.12.2,123") |
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
| CREATE DEFINER=`valtoni`@`%` PROCEDURE `get_memory`() | |
| BEGIN | |
| DECLARE var VARCHAR(64); | |
| DECLARE val VARCHAR(1024); | |
| DECLARE done INT; | |
| #Variables for storing calculations | |
| DECLARE GLOBAL_SUM DOUBLE; | |
| DECLARE PER_THREAD_SUM DOUBLE; |
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
| DT = data.table(A=c("Peter Parker", "Bruce Wayne", "Barry Allen", "Diana", "Clark Kent"), | |
| B=c("Spiderman", "Batman", "Flash", "Wonderwoman", "Superman"), | |
| C=c("Dr. Octopus", "Joker", "Magenta", "Baroness Paula von Gunther", "Lex Luthor")) | |
| d1 <- copy(DT) | |
| d2 <- copy(DT) | |
| d3 <- copy(DT) | |
| setorder(d1, A) |
NewerOlder