I have an updated version of this on my blog here: https://chrisamico.com/blog/2023-01-14/python-setup/.
This is my recommended Python setup, as of Fall 2022. The Python landscape can be a confusing mess of overlapping tools that sometimes don't work well together. This is an effort to standardize our approach and environments.
- Python docs: https://docs.python.org/3/
- Python Standard Library: - Start here when you're trying to solve a specific problem
- Working of indexes in PostgreSQL : https://dba.stackexchange.com/a/7484/8783
- DevOps culture: Learning culture : https://cloud.google.com/solutions/devops/devops-culture-learning-culture
- Awesome Site Reliability Engineering : https://github.com/TheRockStarDBA/awesome-sre or https://sre.xyz/
- ParallelChange : https://martinfowler.com/bliki/ParallelChange.html
- Deployment automation : https://cloud.google.com/solutions/devops/devops-tech-deployment-automation
- Defining SLOs : https://cloud.google.com/solutions/defining-SLOs
- Setting SLOs: a step-by-step guide : https://cloud.google.com/blog/products/management-tools/practical-guide-to-setting-slos
- Setting SLOs: observability using custom metrics : https://cloud.google.com/blog/products/management-tools/observability-using-custom-metrics
- Meeting reliability challenges with SRE principles : https://cloud.google.com/blog/products/management-tools/meeting-reliability-challenges-with-sre-principles
- How maintenance windows affect your error budget—SRE tips : https://cloud.google.com/blog/products/management-tools/sre-error-budget
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
for ($i=1;$i -le 5;$i++) { | |
try { | |
Connect-ExchangeOnline -Credential $Credential -Verbose:$false -ShowProgress $false -Force -WarningAction silentlycontinue 6>$null | |
} catch { | |
if ($i -ge 2) {Write-Warning "Connect-ExchangeOnline Retry $i"} | |
[float]$sleepTimer = [Math]::Pow(2,$i) + [float]((Get-Random -Max 1000) /1000 ) | |
Write-Warning "Connect-ExchangeOnline PS Remoting Error (retry: $sleeptimer sec): $PSItem" | |
Start-Sleep $sleeptimer | |
continue | |
} |
- Python learning and/or Coding Challange :
- https://exercism.io/tracks/python
- https://www.codecademy.com/courses/learn-python-3
- https://www.learnpython.dev/01-introduction/
- https://realpython.com/courses/functional-programming-python/
- https://amitness.com/2019/08/math-for-programmers/
- https://snarky.ca/why-you-should-use-python-m-pip/
- https://courses.packtpub.com/courses/take/python/texts/8903380-exercise-1-getting-to-know-the-order-of-operations
- https://github.com/PacktWorkshops/The-Python-Workshop
- https://www.freecodecamp.org/news/search/?query=python
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
REGION=eu-west-1 | |
VER=1.7.3 | |
RUNTIME=python3.7 | |
docker run -v $(pwd):/out -it lambci/lambda:build-$RUNTIME \ | |
pip install scrapy==$VER -t /out/build/scrapy/python | |
cd build/scrapy | |
zip -r ../../scrapy.zip python/ | |
cd ../.. |
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
<# | |
.SYNOPSIS | |
Reports if your password is pwned by querying haveibeenpwned.com | |
.DESCRIPTION | |
Query haveibeenpwned.com to see if a password has appeared in a breach. | |
The query sends the first 5 characters of the SHA1 hash, so the query should be considered safe and anonymous. |
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
#Requires -RunAsAdministrator | |
function Uninstall-Pester ([switch]$All) { | |
if ([IntPtr]::Size * 8 -ne 64) { throw "Run this script from 64bit PowerShell." } | |
#Requires -RunAsAdministrator | |
$pesterPaths = foreach ($programFiles in ($env:ProgramFiles, ${env:ProgramFiles(x86)})) { | |
$path = "$programFiles\WindowsPowerShell\Modules\Pester" | |
if ($null -ne $programFiles -and (Test-Path $path)) { | |
if ($All) { |
NewerOlder