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 sentiment(sentiment) { | |
if (sentiment && sentiment.label) { | |
switch(sentiment.label) { | |
case "StrongNegativeSentiment": | |
case "StrongNegativeEmoticon": | |
return { | |
startIndex: sentiment.offset, | |
endIndex: sentiment.offset + sentiment.text.length, | |
text: sentiment.text, | |
type: "NEGATIVE", |
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
for D in ` find . -maxdepth 2 -type f -name 'pom.xml' | sed -r 's|/[^/]+$||' | sort -u` | |
do | |
(cd $D && mvn -o dependency:tree | | |
grep -E ":.*:.*:(compile|test)" | | |
sed "s,\[INFO\] \(.\)[ |\\+-]*\([^:]*\):\([^:]*\):[^:]*:[^:]*:\([^:]*\),\1;\2;\3;\4,g" | | |
sed "s,[ |];,transitive;,g" | | |
sed "s,[+\\];,direct;,g") | |
done | sort -u | (echo "type;group;artefact;scope" && cat) |
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.example.demo; | |
import com.sap.hcp.cf.logging.servlet.filter.RequestLoggingFilter; | |
import org.apache.catalina.Context; | |
import org.apache.catalina.startup.Tomcat; | |
import org.apache.tomcat.util.descriptor.web.FilterDef; | |
import org.apache.tomcat.util.descriptor.web.FilterMap; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<localRepository>${user.home}/.m2/repository</localRepository> | |
<proxies> | |
<proxy> | |
<id>http</id> |
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
const database = new rds.DatabaseInstance(this, 'example', { | |
engine: rds.DatabaseInstanceEngine.postgres({ version: rds.PostgresEngineVersion.VER_11 }), | |
vpc: ec2.Vpc.fromLookup(this, 'vpc', { isDefault: true }), | |
credentials: rds.Credentials.fromGeneratedSecret('admin'), | |
// other RDS instance properties | |
}); | |
database.addRotationSingleUser({ | |
automaticallyAfter: cdk.Duration.days(8 * 7), | |
excludeCharacters: '!@#$%^&*' |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Sid": "DenyAllExceptListedIfNoMFA", | |
"Effect": "Deny", | |
"NotAction": [ | |
"iam:ChangePassword", | |
"iam:GetAccountPasswordPolicy", | |
"iam:CreateVirtualMFADevice", |
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 Unlock-Bw() { | |
$status = bw status | ConvertFrom-Json | |
if ($status.status -eq "locked") { | |
$password = (Get-Credential "Bitwarden").GetNetworkCredential().Password | |
$session = bw unlock $password --raw | |
$env:BW_SESSION = $session | |
} | |
} | |
# and later on, to wipe the session |
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 Find-BWField() { | |
param ($item, $name) | |
[Array]::Find($item.fields, [Predicate[Object]] { $args[0].name -eq $name }).value | |
} | |
$item = bw get item $id | ConvertFrom-Json | |
$account = Find-BWField -item $item -name "ACCOUNT" | |
$keyId = Find-BWField -item $item -name "ACCESS_KEY_ID" | |
$secretKey = Find-BWField -item $item -name "SECRET_ACCESS_KEY" |
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
$path = ".\$($id).xml" #id = BW item name | |
function Write-Cache() { | |
param ($value) | |
$secure = ConvertTo-SecureString -AsPlainText -Force -String $value | |
$obj = New-Object -TypeName System.Management.Automation.PSCredential ` | |
-ArgumentList "myusername", $secure | |
return $obj | Export-Clixml $path | |
} |
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
if ((Find-BWField -item $item -name "IS_ROOT") -eq "true") { | |
$mfaArn = "arn:aws:iam::$($account):mfa/root-account-mfa-device" | |
} else { | |
$mfaArn = "arn:aws:iam::$($account):mfa/$($item.login.username)" | |
} | |
if ($item.login.totp) { | |
$token = bw get totp $id | |
$result = aws sts get-session-token --serial-number $mfaArn --token-code $token ` | |
--duration-seconds $sessionLifetime | ConvertFrom-Json |
OlderNewer