The maintained version now lives at ProxMox Cluster - Soup-to-Nutz, part of scyto/homelab-docs.
Questions or troubleshooting? Continue the conversation here — a Q&A discussion where replies thread properly, answers can be marked, and everything is searchable. The 51 comments below stay exactly where they are as an archive.
| # TODO: Setup https://github.com/silvermine/serverless-plugin-cloudfront-lambda-edge | |
| sentryOriginReq: | |
| handler: handlers/handler.default | |
| lambdaAtEdge: | |
| distribution: AppDistribution | |
| eventType: origin-request | |
| includeBody: true | |
| pathPattern: /_tunnel # TODO: Choose tunnel path. |
| #!/bin/bash | |
| APIKEY="From Here https://api.slack.com/custom-integrations/legacy-tokens" | |
| SONG=$(osascript -e 'tell application "Spotify" to name of current track as string') | |
| URLSONG=$(echo "$SONG" | perl -MURI::Escape -ne 'chomp;print uri_escape($_),"\n"') | |
| while true | |
| do | |
| curl -s -d "payload=$json" "https://slack.com/api/users.profile.set?token="$APIKEY"&profile=%7B%22status_text%22%3A%22"$URLSONG"%22%2C%22status_emoji%22%3A%22%3Amusical_note%3A%22%7D" > /dev/null | |
| sleep 60 | |
| done |
This sample includes a continuous deployment pipiline for websites built with React. We use AWS CodePipeline, CodeBuild, and SAM to deploy the application. To deploy the application to S3 using SAM we use a custom CloudFormation resource.
buildspec.yml: YAML configuration for CodeBuild, this file should be in the root of your code repositoryconfigure.js: Script executed in the build step to generate a config.json file for the application, this is used to include values exported by other CloudFormation stacks (separate services of the same application).index.js: Custom CloudFormation resource that publishes the website to an S3 bucket. As you can see from the buildspec and SAM template, this function is located in as3-deployment-custom-resourcesub-folder of the repoapp-sam.yaml: Serverless Application model YAML file. This configures the S3 bucket and the cu
I have been playing with using the https://Home-Assistant.io system at home to play with Home Automation.
One thing I've found is that the Raspberry Pi is perfect for quite a few of the monitoring things that I wanted it to do (see also https://github.com/JonTheNiceGuy/home-assistant-configs for more details of what I'm doing there!).
I'm using the http://OwnTracks.org application to talk to an MQTT server, but I could also do with it knowing where I am in the house, so I looked around for some details on iBeacons.
iBeacon is an Apple standard, but it's very easy to configure on Linux systems. I took some pointers from this article and wrote up this script. When I later went to deploy this on another system, I also needed a pointer from [this PDF](https://cdn-learn.adafruit.com/downloads/pdf/pibeacon-ib
I'm going to walk you through the steps for setting up a AWS Lambda to talk to the internet and a VPC. Let's dive in.
So it might be really unintuitive at first but lambda functions have three states.
- No VPC, where it can talk openly to the web, but can't talk to any of your AWS services.
- VPC, the default setting where the lambda function can talk to your AWS services but can't talk to the web.
- VPC with NAT, The best of both worlds, AWS services and web.
| # If you don't remember the exact path/name, search the log for deleted files | |
| git log --diff-filter=D --summary | grep delete | |
| # Find the file you want to get from the ouput, and use the path | |
| # Find the commits that involved that path | |
| git log --all -- some/path/to/deleted.file | |
| # Bring the file back to life to the current repo (sha commit of parent of commit that deleted) | |
| git checkout shaofthecommitthatdeletedthefile^ -- some/path/to/deleted.file |
| #!/bin/sh | |
| ### | |
| # SOME COMMANDS WILL NOT WORK ON macOS (Sierra or newer) | |
| # For Sierra or newer, see https://github.com/mathiasbynens/dotfiles/blob/master/.macos | |
| ### | |
| # Alot of these configs have been taken from the various places | |
| # on the web, most from here | |
| # https://github.com/mathiasbynens/dotfiles/blob/5b3c8418ed42d93af2e647dc9d122f25cc034871/.osx |
| // LZW-compress a string | |
| function lzw_encode(s) { | |
| var dict = {}; | |
| var data = (s + "").split(""); | |
| var out = []; | |
| var currChar; | |
| var phrase = data[0]; | |
| var code = 256; | |
| for (var i=1; i<data.length; i++) { | |
| currChar=data[i]; |