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 subprocess import check_output, STDOUT, CREATE_NO_WINDOW | |
def rdp_connected(self, ttl_hash=None): | |
output = check_output('qwinsta', stderr=STDOUT, | |
creationflags=CREATE_NO_WINDOW).decode('latin1') | |
for line in output.split('\r\n'): | |
if 'rdp-tcp#' in line and 'Active' in line: | |
log.info(line) | |
return True | |
return False |
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 pathlib import Path | |
import eyed3 | |
p = Path('.') | |
for file in p.glob('**/*.mp3'): | |
mp3 = eyed3.load(file) | |
if mp3: | |
title = str(file).split('\\')[1] | |
print(f"Saving title {title}") |
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
arn:aws:iam::aws:policy/AWSDirectConnectReadOnlyAccess | |
arn:aws:iam::aws:policy/AmazonGlacierReadOnlyAccess | |
arn:aws:iam::aws:policy/AWSMarketplaceFullAccess | |
arn:aws:iam::aws:policy/aws-service-role/ClientVPNServiceRolePolicy | |
arn:aws:iam::aws:policy/AWSSSODirectoryAdministrator | |
arn:aws:iam::aws:policy/AWSIoT1ClickReadOnlyAccess | |
arn:aws:iam::aws:policy/AutoScalingConsoleReadOnlyAccess | |
arn:aws:iam::aws:policy/service-role/AmazonDMSRedshiftS3Role | |
arn:aws:iam::aws:policy/service-role/AWSQuickSightListIAM | |
arn:aws:iam::aws:policy/AWSHealthFullAccess |
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 run -u1000:1000 -e MYSQL_ROOT_PASSWORD=password \ | |
--mount type=bind,source=/home/user/dbstorage,target=/var/lib/mysql \ | |
--name tmp_mariadb mariadb |
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 pathlib import Path | |
from PIL import Image | |
import os | |
p = Path('.') | |
for file in p.glob('*.webp'): | |
im = Image.open(file) | |
im.save(f"{file}.png", "png") | |
os.remove(file) |
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
exchange_rate{currency="australie-dolar"} 14.706 | |
exchange_rate{currency="brazilie-real"} 4.469 | |
exchange_rate{currency="bulharsko-lev"} 12.079 | |
exchange_rate{currency="cina-zen-min-pi"} 3.087 |
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
05.06.2023 #107 | |
země|měna|množství|kód|kurz | |
Austrálie|dolar|1|AUD|14,539 | |
Brazílie|real|1|BRL|4,459 | |
Bulharsko|lev|1|BGN|12,051 |
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
const fs = require('fs'); | |
// Read the text file | |
const fileContent = fs.readFileSync('exchange_rates.txt', 'utf-8'); | |
// Split the content by new lines to get individual rows | |
const rows = fileContent.split('\n'); | |
// Initialize an empty array to store the currency data | |
const currencyData = []; |
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
const axios = require('axios'); | |
const fs = require('fs'); | |
const express = require('express'); | |
const app = express(); | |
const port = 8080; | |
const filePath = 'exchange_rates.txt'; | |
const fileUrl = 'https://www.cnb.cz/cs/financni-trhy/devizovy-trh/kurzy-devizoveho-trhu/kurzy-devizoveho-trhu/denni_kurz.txt' | |
function replaceSpacesAndDiacritics(input) { |
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 node:20 | |
# Create app directory | |
WORKDIR /usr/src/app | |
# Install app dependencies | |
# A wildcard is used to ensure both package.json AND package-lock.json are copied | |
# where available (npm@5+) | |
COPY package*.json ./ |
OlderNewer