This file contains 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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "Test template for creating a beanstalk environment", | |
"Parameters" : { | |
"VPC": { | |
"Description" : "The AWS VPC to use.", | |
"Type": "AWS::EC2::VPC::Id" | |
}, | |
"SubnetA": { | |
"Description" : "The Subnet in AZ A.", |
This file contains 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
{ | |
"Outputs":{ | |
"AWSEBLoadBalancerURL":{ | |
"Value":{ | |
"Fn::Join":[ | |
"", | |
[ | |
"http:\/\/", | |
{ | |
"Fn::GetAtt":[ |
This file contains 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
{ | |
"AWSTemplateFormatVersion" : "2010-09-09", | |
"Description" : "AWS Quick Start Demo - Elastic Beanstalk App Setup.", | |
"Parameters" : { | |
"VPC": { | |
"Description" : "ID of the VPC to use", | |
"Type": "String", | |
"MinLength": "1", |
This file contains 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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "Infrastructure for the Spring Boot + Docker + CFN sample", | |
"Parameters": { | |
"Version": { | |
"Type": "String", | |
"Default": "1.0.0" | |
} | |
}, | |
"Resources": { |
This file contains 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
# I moved this all to https://github.com/CCOSTAN/Home-AssistantConfig - I won't be updating this file anymore. | |
homeassistant: | |
name: Bear Stone Run | |
latitude: !secret homeassistant_latitude | |
longitude: !secret homeassistant_longitude | |
elevation: !secret homeassistant_elevation | |
unit_system: imperial |
This file contains 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
Running shell scripts that have contain sudo commands in them from jenkins might not run as expected. To fix this, follow along | |
Simple steps: | |
1. On ubuntu based systems, run " $ sudo visudo " | |
2. this will open /etc/sudoers file. | |
3. If your jenkins user is already in that file, then modify to look like this: | |
jenkins ALL=(ALL) NOPASSWD: ALL | |
4. save the file by doing Ctrl+O (dont save in tmp file. save in /etc/sudoers, confirm overwrite) | |
5. Exit by doing Ctrl+X | |
6. Relaunch your jenkins job |
This file contains 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
function sendDailyNewsToKindle() { | |
var todayDate=Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "dd.MM.YY"); | |
var url="http://anynewsite.com/{dt}"; | |
var urlPick=url.replace("{dt}",todayDate); | |
var response = UrlFetchApp.fetch(urlPick , {}); | |
var todayDateN=Utilities.formatDate(new Date(), Session.getScriptTimeZone(), "dd.MMM.YYYY"); | |
//convert the response to a blob and store in our array | |
var file1 = response.getBlob().setName(todayDateN + "News.pdf"); |
This file contains 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
function processKindleFiles() { | |
try { | |
var folderId = "0BwgWw6nnA_fCQW5XQzhtUU00TjQ"; | |
// Get folder by id | |
var parentFolder = DriveApp.getFolderById(folderId); | |
var files = parentFolder.getFiles(); | |
while (files.hasNext()) { | |
var childFile = files.next(); |
This file contains 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
public static void CompressAndDownload(HttpResponseBase _response, string zipFilename, List<FileCompressInfo> files) | |
{ | |
MemoryStream outputMemStream = new MemoryStream(); | |
ZipOutputStream zipStream = new ZipOutputStream(outputMemStream); | |
zipStream.SetLevel(3); //0-9, 9 being the highest level of compression | |
byte[] bytes = null; | |
foreach (var file in files) | |
{ |
This file contains 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
public async Task MyAsyncMethod() | |
{ | |
// do some stuff async, don't return any data | |
} | |
public string GetStringData() | |
{ | |
// Run async, no warning, exception are catched | |
RunAsync(MyAsyncMethod()); | |
return "hello world"; |