A simple Bash scripts to start and stop an EC2 Windows Server.
The script also updates an RDP sub-domain address on CloudFlare.
The required IAM must include:
{
"Version": "2012-10-17",
"Statement": [
# First | |
aws cloudfront create-invalidation --distribution-id ************* --paths "/example/path/*" | |
# Then take the invalidation ID from the response and verify the progress | |
aws cloudfront get-invalidation --id ************* --distribution-id ************* |
public abstract class ExceptionUtils { | |
public static <T> T wrapCheckedException(final CheckedExceptionThrowingSupplier<T> supplier) { | |
T suppliedValue = null; | |
try { | |
suppliedValue = supplier.get(); | |
} catch (final Exception originalException) { | |
wrapAndRethrowIfChecked(originalException); | |
} | |
return suppliedValue; |
import org.springframework.http.HttpRequest; | |
import org.springframework.http.client.ClientHttpRequestExecution; | |
import org.springframework.http.client.ClientHttpRequestInterceptor; | |
import org.springframework.http.client.ClientHttpResponse; | |
import java.io.IOException; | |
public class PlainTextStatisticHttpRequestInterceptor implements ClientHttpRequestInterceptor { | |
@Override |
git commit --amend --no-edit | |
git push -f |
A simple Bash scripts to start and stop an EC2 Windows Server.
The script also updates an RDP sub-domain address on CloudFlare.
The required IAM must include:
{
"Version": "2012-10-17",
"Statement": [
package step_definitions; | |
import io.cucumber.datatable.DataTable; | |
import io.cucumber.java.en.Given; | |
import io.cucumber.java.en.Then; | |
import io.cucumber.java.en.When; | |
import java.util.ArrayList; | |
import java.util.List; |
[alias] | |
graph = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all |
# Inspect - Prints out the status for each container's policy | |
for id in $(docker ps -q); do echo "$id$(docker inspect --format='{{.Name}}' $id)" && docker inspect -f "{{ .HostConfig.RestartPolicy.Name }}" $id && echo "------------"; done | |
# Update (if unset) - Updates the policy for each container to 'alway' if its policy is unset. It also prints out the status for each container | |
for id in $(docker ps -q); do echo "$id$(docker inspect --format='{{.Name}}' $id)" && ([ -z "\$(docker inspect -f '{{ .HostConfig.RestartPolicy.Name }}' $id)" ] && docker update --restart=always $id; exit 0 ) && docker inspect -f "{{ .HostConfig.RestartPolicy.Name }}" $id && echo "------------"; done |
private Object[] getColumn(int address, Object[][] from) { | |
return Arrays.stream(from).map(x -> x[address]).toArray(Object[]::new); | |
} | |
private <T> T[] getColumn(int address, T[][] from) { | |
return (T[]) Arrays.stream(from).map(x -> x[address]).toArray(Object[]::new); | |
} |
sudo apt update | |
sudo apt install mysql-server | |
sudo mysql_secure_installation | |
This seems to lock it down to the Ubuntu root user, therefore login using the Ubuntu root user | |
and run the following. | |
sudo mysql -u root | |
DROP USER 'root'@'%'; | |
CREATE USER 'root'@'localhost' IDENTIFIED BY ''; |