Use Python to:
- send a plain text email
- send an email with attachment
- receive and filter emails according to some criteria
Use Python to:
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "strconv" | |
| "github.com/miekg/dns" | |
| ) |
| #!/bin/bash | |
| # | |
| # Installation of Hashicorp Nomad for deploy process | |
| # | |
| # Download this file: | |
| # curl -sSL https://gist.githubusercontent.com/ryanpadilha/351a4a4f17afdc8eb0d963897b98122a/raw/ -o nomad-install.sh | |
| # | |
| echo "Initializing script for devops - Nomad Hashicorp" |
| package main | |
| import ( | |
| "go.uber.org/zap" | |
| "encoding/json" | |
| ) | |
| func main() { | |
| cfg := zap.NewProductionConfig() |
| package main | |
| import ( | |
| "crypto/sha256" | |
| "fmt" | |
| "io" | |
| "log" | |
| "os" | |
| ) |
| # List Cron Jobs | |
| $ for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done | |
| $ for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done | |
| # Edit crontab | |
| $ sudo crontab -e -u www-data |
| #!/usr/bin/env bash | |
| if [[ $(pmset -g ps | head -1) =~ "Battery Power" ]]; then | |
| osascript -e 'display notification "You are starting Slack while running on battery power" with title "Battery Drain Source Detected" subtitle ""' | |
| fi | |
| open /Applications/Slack.app |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| # Copyright 2017, Google, Inc. | |
| # Licensed under the Apache License, Version 2.0 (the "License") | |
| FROM node:6-onbuild | |
| EXPOSE 3000 | |
| ENV LANGUAGE English | |
| ENV API_KEY 123-456-789 |
| https://github.com/kubernetes/client-go/tree/master/examples/in-cluster-client-configuration |