2021-05-08
Простой надежный прерыватель указателя поворотов
2021-03-11
AWS
aws lambda invoke --function-name=<fn> --region=us-west-1 out.txt
asw s3 ls
awsconsole > my security credentials > Access keys
aws configure
aws ec2 describe-regions
aws s3 mb s3://asfg
aws s3 sync s3://asdf --delete
aws s3 cp /path/to/file s3://sample_bucket --acl public-read
final static String ACCESS_KEY = "";
final static String SECRET_KEY = "";
final static Regions REGION = Regions.EU_CENTRAL_1;
// final AmazonS3 s3 = AmazonS3ClientBuilder.defaultClient();
final AmazonS3 s3 = AmazonS3ClientBuilder.standard()
.withCredentials(new AWSStaticCredentialsProvider(new BasicAWSCredentials(ACCESS_KEY, SECRET_KEY)))
.withRegion(REGION)
.build();
List<Bucket> list = s3.listBuckets();
2021-02-26
Windows cleanup
win+r disk cleanup
win+r %temp%
Select the Start button, then select Settings > Apps > Startup.
Ubuntu autorun
alt+F2 gnome-session-properties
gnome-startup-applications
2021-02-24
AWS
SIMPLE MONTHLY CALCULATOR
https://calculator.s3.amazonaws.com/index.html
AWS Free Tier
https://aws.amazon.com/free/?nc2=smc&all-free-tier.sort-by=item.additionalFields.SortRank&all-free-tier.sort-order=asc&awsf.Free%20Tier%20Categories=categories%23databases
aws configure
aws dynamodb describe-table --table-name BaseballStats
aws dynamodb batch-write-item --request-items file://./teams.json
aws dynamodb scan --return-consumed-capacity "TOTAL" --table-name BaseballStats
aws ec2 describe-instances --profile prod-user
AWS credentials provider chain that looks for credentials in this order:
- Environment Variables -
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEY(RECOMMENDED since they are recognized by all the AWS SDKs and CLI except for .NET), orAWS_ACCESS_KEYandAWS_SECRET_KEY(only recognized by Java SDK) - Java System Properties - aws.accessKeyId and aws.secretKey
- Web Identity Token credentials from the environment or container
- Credential profiles file at the default location (~/.aws/credentials) shared by all AWS SDKs and the AWS CLI
- Credentials delivered through the Amazon EC2 container service if AWS_CONTAINER_CREDENTIALS_RELATIVE_URI" environment variable is set and security manager has permission to access the variable,
- Instance profile credentials delivered through the Amazon EC2 metadata service
sudo yum remove java-1.6.
sudo yum install java-1.8.0-openjdk-devel
sudo alternatives --config java
sudo yum install apache-maven
mvn -v
export JAVA_HOME=
mvn -v
aws sr mb s3://asdf.com
aws s3 ls s3://asdf.com
./mvnw clean install
maven reload all projects
./mvnw clean verify
2021-01-14
RESTfull API
REST API Architectural Constraints:
A Restful system consists of a:
- client who requests for the resources.
- server who has the resources.
Architectural Constraints of RESTful API:
- Uniform Interface
- Stateless
- Cacheable
- Client-Server
- Layered System
- Code on Demand
RESTfull = REST over HTTP
| GET | 200 OK | 404 Not Found |
| POST | 201 Created | 404 Not Found
401 Unauthoriized 409 Conflict |
| PUT PATCH |
200 OK | 404 Not Found
401 Unauthoriized 405 Method Not Allowed |
| DELETE | 200 OK | 404 Not Found 401 Unauthoriized |
| OPTIONS | 200 OK | |
| HEAD | 200 OK | 404 Not Found |
Response code:
1xx Information
2xx Success
3xx Redirect
4xx Client error
400 - Bad request
401 - Unauthorized
403 - Forbidden
404 - Not found
405 - Method not allowed
5xx Server error
2020-11-12
MySQL
connect phpMyAdmin to localhost:3307
https://www.digitalocean.com/community/tutorials/how-to-install-linux-apache-mysql-php-lamp-stack-ubuntu-18-04#step-2-%E2%80%94-installing-mysql
vim /etc/phpmyadmin/config-db.php
/etc/init.d/apache2 restart
ALTER USER 'asdf'@'%' IDENTIFIED WITH mysql_native_password
BY '123';
FLUSH PRIVILEGES;
SELECT user,authentication_string,plugin,host FROM mysql.user;
2020-11-09
MS SQL
SELECT name, database_id, create_date FROM sys.databases ; GO
SELECT name FROM sys.databases ;
USE AdventureWorks2012;
SELECT DATEADD(month, 1, '20060830');
UPDATE column SET am=DATEADD(month, 1, column)
2020-11-03
AMD compatibility
https://dlcdnets.asus.com/pub/ASUS/mb/SocketAM4/PRIME_A320M-E/Memory_QVL_for_AMD_Ryzen_2nd_Generation_Processors.pdf
https://www.amd.com/en/products/apu/7th-gen-a6-9500e-apu
https://dlcdnets.asus.com/pub/ASUS/mb/LGA1151/Z170-K/E11133_MB_Pin_Definition_v2_web_only.pdf
https://dlcdnets.asus.com/pub/ASUS/mb/SocketAM4/PRIME_A320M-E/PRIME_A320M-E_Devices_report.pdf?_ga=2.150868278.121035418.1589210573-1092435267.1587983989
2020-10-04
SSL
https://www.baeldung.com/spring-boot-https-self-signed-certificate
keytool -genkeypair -alias baeldung -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore baeldung.p12 -validity 3650
https://mkyong.com/spring-boot/spring-boot-ssl-https-examples/
$ keytool -genkeypair -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore mkyong.p12 -validity 365
https://letsencrypt.org/ru/getting-started/
https://certbot.eff.org/lets-encrypt/ubuntubionic-other
sudo certbot certonly --standalone
https://dzone.com/articles/spring-boot-secured-by-lets-encrypt
/etc/letsencrypt/live/asdf.pp.ua# openssl pkcs12 -export -in fullchain.pem -inkey privkey.pem -out keystore.p12 -name tomcat -CAfile chain.pem -caname root
2020-10-01
Time Complexity
https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444
O(1) — Constant Time
O(N)—Linear Time
O(log(n)) — Logarithmic Time
O(N²) — Quadratic Time
O(2^N) — Exponential Time