Make the document user profile
cd $env:USERPROFILE\Documents
md WindowsPowerShell -ErrorAction SilentlyContinue
New-Item -Path $Profile -Type File
Using a function the contents of Microsoft.PowerShell_profile.ps1
can be:
import os | |
from dotenv import load_dotenv | |
from azure.appconfiguration import AzureAppConfigurationClient, ConfigurationSetting | |
class ConfigManager: | |
def __init__(self): | |
# Load environment variables from .env file for local development | |
load_dotenv() | |
# Check if running in Azure environment |
Make the document user profile
cd $env:USERPROFILE\Documents
md WindowsPowerShell -ErrorAction SilentlyContinue
New-Item -Path $Profile -Type File
Using a function the contents of Microsoft.PowerShell_profile.ps1
can be:
# Extract the identifying URLs using terraform plan | |
terraform plan | grep "Refreshing state" > terraform-current-states.txt | |
# Extract the states we know from the configuration | |
terraform state list > terraform-state-list.txt | |
# Subscription strings | |
OLD_SUBSCRIPTION=00000000-0000-0000-0000-000000000000 | |
NEW_SUBSCRIPTION=11111111-1111-1111-1111-111111111111 | |
# Resource group strings (other name) | |
OLD_RG='Rg-appname-TST' |
name: Build and Push Docker Image | |
on: | |
push: | |
branches: | |
- main | |
env: | |
ECR_REGISTRY: <your ECR registry URL> | |
ECR_REPOSITORY: <your ECR repository name> |
name: Deploy | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest |
import { FileUpload } from './../../../models/file-upload'; | |
import { FileUploadService } from './../../../services/file-upload.service'; | |
import { Component, OnInit } from '@angular/core'; | |
@Component({ | |
selector: 'app-company-form', | |
templateUrl: './company-form.component.html', | |
styleUrls: ['./company-form.component.scss'] | |
}) | |
export class CompanyFormComponent implements OnInit { |
pushFileToStorage(fileUpload: FileUpload) { | |
const filePath = `${this.basePath}/${fileUpload.file.name}`; | |
const storageRef = ref(this.storage, filePath); | |
const uploadTask = uploadBytesResumable(storageRef, fileUpload.file); | |
uploadTask.on('state_changed', | |
(snapshot) => { | |
// Observe state change events such as progress, pause, and resume | |
// Get task progress, including the number of bytes uploaded and the total number of bytes to be uploaded |
====== Streamlabs Cloudbot 2020 Updated======
***This is a updated doc for Cloudbot. Supported by Tunerzedge.
Streamlabs Chatbot (SLCB), formerly known as AnkhBot, is a self-hosted bot solution developed by [https://twitter.com/ankhheart|AnkhHeart] for Twitch streamers with a number of unique features, as well as now officially integrates with [https://www.streamlabs.com/|Streamlabs] and its exclusive services. Not to mention the software and all of its features are completely free.
There's numerous resources for learning how to utilize the bot to its fullest potential, but this documentation is an attempt at an all in one, quick and simple source for getting started and beyond. It's also important to note that a lot of these commands use an external API, coded and provided by the user [https://decapi.me/|Decicus] that would otherwise be impossible to do with the bot alone.
#!/bin/sh | |
# This script installs automated docker cleanup via "docker image prune" | |
# onto systemd-based systems. | |
# It requires that docker is installed properly | |
# source: https://techoverflow.net/2019/10/03/how-to-automatically-cleanup-prune-docker-images-daily/ | |
cat >/etc/systemd/system/PruneDocker.service <<EOF | |
[Unit] | |
Description=PruneDocker |
#!/usr/bin/env bash | |
#https://techstat.net/automatic-whitelist-cloudflare-ips-firewalld-bash-script-via-cron-job/ | |
SERVER_IP=xxx.xxx.xxx.xxx | |
for i in $(curl "https://www.cloudflare.com/ips-v4"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv4" source address="'$i'" port port=80 protocol=tcp accept'; done | |
for i in $(curl "https://www.cloudflare.com/ips-v4"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv4" source address="'$i'" port port=443 protocol=tcp accept'; done | |
for i in $(curl "https://www.cloudflare.com/ips-v6"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv6" source address="'$i'" port port=80 protocol=tcp accept'; done | |
for i in $(curl "https://www.cloudflare.com/ips-v6"); do sudo firewall-cmd --permanent --zone=public --add-rich-rule 'rule family="ipv6" source address="'$i'" port port=443 protocol=tcp accept'; done |