This file contains 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
# MIT License | |
# Copyright (c) 2023 Dawid Goslawski | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: |
This file contains 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
def ssm_parameters(): | |
ssm_path = "/example/path/" # / at the end | |
ssm = boto3.client('ssm', region_name='eu-west-1') | |
parameters = ssm.get_parameters_by_path(Path=ssm_path, WithDecryption=True)[ | |
'Parameters' | |
] | |
return {x['Name'].replace(ssm_path, ""): x['Value'] for x in parameters} | |
This file contains 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
from imaplib import IMAP4_SSL | |
try: | |
client = IMAP4_SSL("imap.gmail.com") | |
client.login(user, passw) | |
client.select("INBOX") | |
# https://datatracker.ietf.org/doc/html/rfc3501#section-6.4.4 | |
typ, msgnums =client.search(None, '(FROM "wp.pl")') |
This file contains 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
package main | |
import ( | |
"github.com/go-ping/ping" | |
"fmt" | |
"time" | |
) | |
func main() { |
This file contains 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
rem asar v3.0.3, slack 4.8.0 | |
rem sed is from scoop git package, also in unxutils-separated or standard unxutils | |
set SLACK_HOME=%USERPROFILE%\scoop\apps\slack\current | |
npm install -g asar | |
cd %SLACK_HOME%\resources | |
asar extract app.asar slack-source | |
del app.asar | |
sed -i "s@searchGoogle@searchDuckDuckGo@g" slack-source/dist/main.bundle.js | |
sed -i "s@https://www.google.com/search?q=@https://duckduckgo.com/?q=@" slack-source/dist/main.bundle.js |
This file contains 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
docker system prune | |
docker image prune --all # remove also unused named images |
This file contains 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
@echo off | |
:: | |
:: RefreshEnv.cmd | |
:: | |
:: Batch file to read environment variables from registry and | |
:: set session variables to these values. | |
:: | |
:: With this batch file, there should be no need to reload command | |
:: environment every time you want environment changes to propagate | |
:: |
This file contains 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
@echo off | |
for %%I in (.) do title %%~nxI |
This file contains 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
@echo off | |
bcdedit | findstr "hypervisorlaunchtype" | findstr Auto > nul | |
if %ERRORLEVEL% == 1 (bcdedit /set hypervisorlaunchtype auto 1>nul && echo HyperV ON / Docker Mode ) else (bcdedit /set hypervisorlaunchtype off 1>nul && echo HyperV OFF / Virtualbox Mode) |
This file contains 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
import jenkins.* | |
import jenkins.model.* | |
import hudson.* | |
import hudson.model.* | |
import org.apache.commons.io.IOUtils | |
def jenkinsCredentials = com.cloudbees.plugins.credentials.CredentialsProvider.lookupCredentials( | |
com.cloudbees.plugins.credentials.Credentials.class, | |
Jenkins.instance, | |
null, | |
null |
NewerOlder