惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
宝玉的分享
宝玉的分享
Jina AI
Jina AI
IT之家
IT之家
博客园 - Franky
MyScale Blog
MyScale Blog
Y
Y Combinator Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
I
InfoQ
雷峰网
雷峰网
WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
美团技术团队
S
SegmentFault 最新的问题
罗磊的独立博客
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
D
Docker
博客园 - 司徒正美
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
阮一峰的网络日志
阮一峰的网络日志
M
MIT News - Artificial intelligence

Stonecharioteer on Tech

I Traced My Traffic Through a Home Tailscale Exit Node What Was I Reading Last? In Three Not-So-Easy Pieces Dogfooding Is Hard Code blocks in your books, finally GoForGo v0.9.0 Merrilin - We built an app to read books I use a Macbook now Data Structures & Algorithms - Preparing for Interviews Using a local DNS namespace for local service discovery Direction KOllector - Publishing KOReader Highlights gbt: branches touched in the last 24 hours A Soiree into Symbols in Ruby Some Smalltalk about Ruby Loops Ruby Blocks Returning from Ruby Blocks, Procs and Lambdas My Linux Laptop Finally Works: How Claude Helped Me Fix Years of Annoyances TIL: Watchexec - Modern File Watching for Development Workflows A Less Busy Mind GoForGo - Learn Go through live examples Migrating My Old Blog to Hugo with Claude The Qtile Window Manager: A Python-Powered Tiling Experience Read the RFCs that Built the Internet Py-x-Protobuf - Or How I Learned to Stop Worrying and Love Protocol Buffers Python Reverse a List New Beginnings Leaving ChainSafe Systems Screen Lock for Cinnamon Desktop using Zenity and Terminal Commands Crews Not Teams A System for Getting Better at LeetCode
TIL: Python Collections, Git Commands, Juju, and EC2
2020-08-02 · via Stonecharioteer on Tech

Python Programming

Collections Module - defaultdict

  • collections.defaultdict takes a type not a value
  • It will initialize based on the default value for that type
  • Common mistake: passing a value instead of a callable type
  • Example: defaultdict(list) not defaultdict([])
  • Cleaner than manually checking if keys exist before accessing

Version Control

Git Commands and Tricks

  • git log --format="%H" -n 1 | cat outputs the last commit ID
  • Useful for scripting and automation
  • The cat ensures the output is properly formatted
  • %H format specifier gives the full commit hash
  • -n 1 limits to the most recent commit

Cloud Infrastructure and DevOps

AWS EC2 Free Tier

  • EC2 has a Free tier! I can request a bunch of machines here
  • Great for learning and experimenting with cloud infrastructure
  • Limited resources but sufficient for development and testing
  • Good entry point for understanding cloud computing concepts

Juju - Multi-Cloud Orchestration

  • Juju is a tool that helps manage server providers, whether they are GCP, AWS, your own servers or Azure, among others
  • Gives you one way to start, setup and run your servers across different cloud providers
  • Abstracts away cloud provider differences
  • Enables consistent deployment across hybrid and multi-cloud environments

Juju Configuration System

  • Juju’s configurations are called charms
  • These are written in Python
  • Charms define how services should be deployed and configured
  • Reusable deployment patterns for common software stacks
  • Community-maintained charm store with pre-built configurations