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
=begin | |
This computes the answer to Euler problem 2 at https://projecteuler.net/problem=2 | |
The solution takes advantage that | |
- every 3rd number in the sequence is even | |
- odd + odd = even | |
- even + odd = even | |
example below where [2], [8], [34], [144] are F3, F6, F9 |
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
aws> .profile jc@gmail | |
Current shell profile changed to: jc@gmail | |
aws> support describe-trusted-advisor-check-result --check-id eW7HH0l7J9 --query 'result.sort_by(flaggedResources[?statu | |
s!="ok"],&metadata[2])[].metadata' --output table --region us-east-1 | |
A client error (AccessDeniedException) occurred when calling the DescribeTrustedAdvisorCheckResult operation: User: arn:aws:iam::952089433851:user/limitedTestUser is not authorized to perform: support: | |
aws> support describe-trusted-advisor-check-result --check-id eW7HH0l7J9 --query 'result.sort_by(flaggedResources[?statu | |
s!="ok"],&metadata[2])[].metadata' --output table --region us-east-1 | |
A client error (SubscriptionRequiredException) occurred when calling the DescribeTrustedAdvisorCheckResult operation: AWS Premium Support Subscription is required to use this service. |
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
ListUsersRequest request = new ListUsersRequest() | |
request.setMaxItems(20) | |
boolean moreUsers = true | |
List<User> users = new ArrayList<>() | |
while (moreUsers) { | |
ListUsersResult result = client.listUsers(request) | |
request.setMarker(result.getMarker()) | |
users.addAll(result.getUsers()) | |
moreUsers = result.isTruncated() |
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
FROM alpine | |
#2 Add Edge and bleeding repos | |
RUN echo -e '@edge http://nl.alpinelinux.org/alpine/edge/main\n@testing http://nl.alpinelinux.org/alpine/edge/testing' >> /etc/apk/repositories | |
#3 | |
RUN apk update && apk upgrade && apk add --update \ | |
python \ | |
python-dev \ | |
make \ | |
cmake \ | |
gcc \ |
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
BucketLifecycleConfiguration configuration1 = new BucketLifecycleConfiguration(); | |
BucketLifecycleConfiguration.Rule rule = new BucketLifecycleConfiguration.Rule( ); | |
rule.setExpirationInDays(1000); | |
configuration1 = configuration1.withRules(rule); | |
s3client.setBucketLifecycleConfiguration("", configuration1); | |
aws s3api put-bucket-lifecycle --bucket test-repository-tmp --lifecycle-configuration file://newrule.json |
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
package com.shoppertrak.ssclogging | |
import com.mongodb.MongoClient | |
import de.flapdoodle.embed.mongo.MongodExecutable | |
import de.flapdoodle.embed.mongo.MongodProcess | |
import de.flapdoodle.embed.mongo.MongodStarter | |
import de.flapdoodle.embed.mongo.config.MongodConfigBuilder | |
import de.flapdoodle.embed.mongo.config.Net | |
import de.flapdoodle.embed.mongo.distribution.Version | |
import de.flapdoodle.embed.process.runtime.Network |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv='Content-type' content='text/html; charset=utf-8'> | |
<title>Basic Example</title> | |
</head> | |
<body> | |
<h1>Basic Example 2</h1> | |
<div id="container"></div> |
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
package com.retel.security; | |
import org.springframework.security.web.PortResolver; | |
import org.springframework.security.web.PortResolverImpl; | |
import org.springframework.security.web.WebAttributes; | |
import org.springframework.security.web.savedrequest.DefaultSavedRequest; | |
import org.springframework.security.web.util.UrlUtils; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletResponse; |
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
mysqlidfull=$(docker run -e MYSQL_ROOT_PASSWORD=password -d mysql) | |
mysqlid=${mysqlidfull:0:4} | |
mysql=$(docker inspect $mysqlid | grep "Name" | grep "/" | sed 's/^.*\///g' | sed 's/".*$//g') | |
echo "mysql: ${mysql}" | |
docker cp ${mysql}:/var/lib/mysql . |
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
#cloud-config | |
coreos: | |
update: | |
group: alpha | |
reboot-strategy: best-effort | |
fleet: | |
public-ip: $private_ipv4 | |
metadata: cloud=amazon,type=c3.large,spot=true,disk=64gb,subnet=public_retel,class=shoppertrak | |
etcd: |
NewerOlder