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
# list Java processes | |
jcmd -l | |
# list running JVM's system properties or flags (select a 'pid' from above command's result list) | |
jcmd pid VM.system_properties | |
jcmd pid VM.flags |
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
kubectl rollout restart deployment name-of-my-deployment |
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
kubectl delete pods your-pod-name --grace-period=0 --force -n your-namespace-name |
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"?> | |
<configuration> | |
<include resource="org/springframework/boot/logging/logback/defaults.xml"/> | |
<include resource="org/springframework/boot/logging/logback/console-appender.xml"/> | |
<appender name="CLOUD_WATCH_FRIENDLY" class="ch.qos.logback.core.ConsoleAppender"> | |
<encoder> | |
<pattern>%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr([%15.15t]){faint} %clr(%-40.40logger{39}){cyan} %clr(:){faint} %m %replace(%rEx{short}){'[\r\n\t]+', '\\n'}%nopex%n</pattern> | |
</encoder> |
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
import javax.validation.Constraint; | |
import javax.validation.Payload; | |
import java.lang.annotation.*; | |
@Documented | |
@Constraint(validatedBy = ExampleConstraintValidator.class) | |
@Target({ElementType.FIELD}) | |
@Retention(RetentionPolicy.RUNTIME) | |
public @interface ExampleConstraint { |
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
------------------------------------------------------------------------------------------------------ | |
#add x-frame-options header | |
add rewrite action act_insert_XFrame_header insert_http_header X-Frame-Options "\"SAMEORIGIN\"" | |
add rewrite policy pol_enforce_XFrame TRUE act_insert_XFrame_header | |
------------------------------------------------------------------------------------------------------ | |
#add HSTS header | |
add rewrite action act_insert_HSTS_header insert_http_header Strict-Transport-Security "\"max-age=157680000; includeSubDomains; preload\"" | |
add rewrite policy pol_enforce_HSTS TRUE act_insert_HSTS_header | |
------------------------------------------------------------------------------------------------------ | |
#add x-xss-protection header |
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 de.jonasgroeger; | |
import org.junit.jupiter.api.Test; | |
import org.springframework.scheduling.support.CronExpression; | |
import java.time.LocalDateTime; | |
import java.time.ZoneId; | |
class SpringCronExpressionTester { |
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
-- Before importing, you need to create table | |
CREATE TABLE example_table | |
( | |
... | |
); | |
-- Importing... | |
COPY example_table | |
FROM 's3://<BUCKET_NAME>/.../example_table.csv' | |
CREDENTIALS 'aws_access_key_id=...;aws_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
echo "$(TZ='Europe/Moscow' date +%Y-%m-%d\ %H\:%M)" | |
# output => 2019-01-31 16:52 |
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
#!/usr/local/bin/python3 | |
import os | |
hosts = [ | |
'google.com', | |
'microsoft.com' | |
] | |
header = [] |
NewerOlder