2021-09-24

AWS essentials 3 - python lambda

File upload:

 https://gist.github.com/tomfa/87947d2773b60fc3797491d6ef5e3d0e

 

python vs java speed  

https://gist.github.com/badrhub/49b722cf1fb63157cf4d298c48446b38

https://gist.github.com/badrhub/f53ba74e4ad31e4b72b369de93d936ab

2021-09-21

Kstar

 "День онлайн" за 15 грн- 1000 мб або за 30 грн-4000 мб на день.

Послуга «День Онлайн 1000 Мб»: *263*1#, «День Онлайн 4000 Мб»: *273*1#. 
проверка  остатка *263#

2021-09-05

CPU comparizon

CPU/ranking TestSin AllCombi
I3-10100F
453
46/70
M1 Pro
453
70/32 ??? 30/30
Core i7-9750H
748
46 68
Core i5 1135G7
808
33 36
Core i7-10510U 1096 50
Ryzen 3 2200G windows 1098 18 29
Core I5-8250U 1179 W:38 L:19 W:44 L:50
Core i7-2600 1270 W:14/15
Core i5-3550s 1372 W:15/16
AMD Athlon-3000G 1374 W:17
L:19/20
W:25
Core i5-6300U 1603 10
Core i5-4210M 1691 W:26 L:20 W:47 L:45

2021-08-22

Прототип мотор-колеса

1
22
1
22
1
22


оригиналы https://vi.aliexpress.com/store/all-wholesale-products/2383059.html?spm=a2g0o.store_pc_home.pcShopHead_8522459.1

IRF3205 N-канал, 110A, 55V, 0,008om

IRFB3207Z N-канал, 170(75)A, 75V, 0,004om. TO-220.

IRF3808 N-канал, 140(120)A, 75V, 0,007om. TO-220.

===

IRFZ48N N-канал, 64A, 55V, 0,014om

IRLZ44N N-канал, 47A, 55V, 0,022om, логический уровень управле

(IRLB3034 )

IRLZ24N N-канал, 18A, 55V, 0,06om, логический уровень управления
IRFP250N N-канал, 30A, 200V, 0.075om, TO-247AC
IRFP064N N-канал, 110A, 55V, 0.08om, TO-247AC

IRF640N N-канал, 18A, 200V, 0.15 om
IRF530 0,16 om 


Hall sensor - 49Е

https://youtu.be/VbEf4tcJ8MU 

 

---------------------------------

 Крутящий момент 25Н*м = 800Вт

ток 2А, напряжение 3.7В, 

10 витков = 20гр 

40 вит = 80гр

attachInterrupt() 

-----------------------------

Вес медного провода: площадь сечения * плотность = г/м

толщина: 0.35 , сечение= п * r2 = 0.38, вес=0.38 * 8.9 =3.5 г/м

----------------------------- 

Ток и толщина провода:
1А - 0.05мм, 3А -0.11мм, 10А-0.25мм, 15А-0.33мм, 20А-0.4мм, 30А-0.52мм, 40А-0.63мм, 50А-0.73мм, 60А-0.89мм,70А-0.92мм, 80А-1.00мм, 90А-1.08мм, 100А -1.16мм

Таблица нагрузки проводов и кабелей

Сечение, мм2 Открыто проложенный
Медь Алюминий
Iₙ, А кВт Iₙ, А кВт  
220В 380В   220В 380В 



- - - -
0,2 диам 0.5
3?
- - - -
0,28 диам 0.6


- - - -
0,5 диам 0.8
11 2,4 - - - -
0,75 д0.98
15 3,3 - - - -
1 д1,12
17 3,7 11 - - -
1,5 23 5 15 - - -
2,5 30 6,6 19 24 5,3 15,5
4 41 9 26 32 7 20,7
6 50 11 32 39 8,6 25,2
10 80 17,6 52 60 13 38,8
16 100 22 65 75 16,5 48,5
25 140 30,8 90 105 23,1 58,1
35 170 37 110 130 28,6 71
Сечение, мм2 Проложенный в трубе
Медь Алюминий
Iₙ, А кВт Iₙ, А кВт  
220В 380В   220В 380В 
0,5 - - - - - -
0,75 - - - - - -
1 14 3 9 - - -
1,5 15 3,3 9,7 - - -
2,5 21 4,6 13,6 16 3,5 10,3
4 27 5,9 17,4 21 4,6 13,6
6 34 7,5 22 26 5,7 16,8
10 50 11 32,3 28 8,3 24,5
16 80 17,6 51,7 55 12,1 35,5
25 100 22 64,6 65 14,3 42
35 135 29,7 87,2 75 16,5 48,5

Если бытовая розетка выдерживает до 16А, к ней необходимо подводить провод на 1,5 мм², но для защиты нужно поставить автомат на 16А или ниже. Подробнее https://axiomplus.com.ua/news/raschet-i-vybor-secheniya-provoda/

 

Эмалевые провода обладают также высокой термостойкостью, и способны выдерживать температуру до 155°С.

https://electrosam.ru/glavnaja/slabotochnye-seti/provoda/obmotochnye-provoda/  




s
















https://hackaday.com/2023/06/28/you-can-3d-print-a-12500-rpm-brushless-motor/
https://www.youtube.com/watch?v=gBPZYLpVtj4

https://rcopen.com/blogs/108033/15455 Схемы намотки бесколлекторных двигателей


провод 
0.5 55м 100гр
0.4  86м

рабочий ток 
10А на 1 кв мм сечения, то есть 2.5А для 0.5мм ?

1 катушка 
30мм диаметр, 10мм высота,  средняя длина витка 6см, 400 витков 0.5 = 24м (50гр), сопротивление 2Ома, для тока 2.5А напряжение 5Вольт.

https://www.hornbach.sk/p/viecko-5301-12-mm-med/5105088/
https://www.hornbach.sk/p/medena-rurka-makka-o-10-mm-hrubka-steny-1mm-navin-50-m/10457320/
https://www.hornbach.sk/p/medena-trubka-makka-o-8-mm-hrubka-steny-1mm-navin-50-m/10457322/
https://www.hornbach.sk/c/naradie-stroje-a-dielna/naradie/rezacky/rezacky-trubiek-rezacky-na-kov/S24538/

сдвинуть тележку с места, достаточно:
350gr/10gr  = 1/35
500гр/5гр = 1/33
700гр/30гр = 1/23

8Ватт ~ 40гр брашлес мотор с винтом



1

Rb = (45)
Rm = Rb - r
Rm = L/2п = 8*2r/2п =8r/п
Rb - r = 8r/п
Rb = 8r/п + r = r(8/п+1)
r = Rb / (8/п+1)

r = 25, Rb = 44.33

https://www.youtube.com/watch?v=8D1v7n3As-E&t=12s
Как изменить частоту электросети? ЧАСТОТНЫЙ ПРЕОБРАЗОВАТЕЛЬ
https://youtu.be/8D1v7n3As-E?t=282

AutoCAD
Catia
Creo
Inventor
NX
Onshape
Rhino
SketchUp
SolidWorks
SpaceClaim
TinkerCAD
Other

прошивка ESC
https://www.youtube.com/watch?v=lxhfmXkZ9mU 
https://www.youtube.com/watch?v=_AUui1qNYqs
3
1
22
3
1

2021-08-17

Linux setup

Python:

Can't create virtual environment from PyCharm in Ubuntu :

sudo apt-get install python3-virtualenv

sudo apt install -y libbz2-dev libffi-dev libssl-dev

  134  sudo apt-get install pkg-config

  138  sudo apt-get install g++

  139  make clean

  140  ./configure --enable-optimizations

  141  make && make test && sudo make install

  142  pip3 install pyautogui


 

git:

https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

ssh-keygen -t ed25519 -C "your_email@example.com"
ssh-add ~/.ssh/id_ed25519
https://docs.github.com/en/github/authenticating-to-github/connecting-to-github-with-ssh/adding-a-new-ssh-key-to-your-github-account  
$ sudo apt-get update
$ sudo apt-get install xclip
$ xclip -selection clipboard < ~/.ssh/id_ed25519.pub 

arduino:
avrdude: ser_open(): can't open device "/dev/ttyUSB0": Permission denied
sudo usermod -a -G dialout <username>

https://my.canon/en/support/0100588102

http://localhost:631/printers/

2021-06-13

AWS essentials - 2 - try Java SDK - S3 example

1. Set up env (this step is done before)

https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/get-started.html

2. Get the code from ASW Java SDK 

2.1. Set up pom.xml

(waiting for IntelliJ finished it's background tasks,indexing etc)

(I'd use Java 11,  not 1.7)

(dealing with duplicates in pom.xml - "build" section)

ok, the issue is fixed - it's time to run the code

find AWS SDK for Java 2.0 documentation examples

(fixing missing  imports: org.apache.logging.log4j.Logger;TestInstance)

Looks like all the issues are fixed - time to run the test - confirm S3 bucket is created

the bucket is created - bucket-name-2021-06-13, it is empty now - let's upload a file - it says "Test 3 passed" - let's see AWS S3 contents - looks good: the file asdf.txt is copied to S3 as "asdf.in.s3.txt"


2021-06-09

AWS essentials - Step 1 - Create AIM admin user


 1. Create IAM user (we should not use AWS Root account for programmatic access to AWS - we will create corresponding IAM user instead)

2. Install AWS CLI - Command Line Interface

for Linux:
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html#cliv2-linux-install
 
for Windows:
https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-windows.html#cliv2-windows-install 
 
3. Set up AWS credentials
you may use default (us-east-1) region. I will use eu-central-1 for now.

4. Make sure your user is able to connect AWS resources - for example, let's examine S3 access
$ aws s3 mb s3://bucket-name-2021-06-09
and from AWS UI we see the bucket is created: bucket-name-2021-06-09
 
So, first step is done - we've created IAM user and confirmed it has access to AWS 
 
SIMPLE MONTHLY CALCULATOR: 
https://calculator.s3.amazonaws.com/index.html
A newer version of the S3 calculator is available 
https://docs.aws.amazon.com/sdk-for-java/latest/developer-guide/home.html
AWS Code Sample: 
https://docs.aws.amazon.com/code-samples/latest/catalog/code-catalog-javav2-example_code-ses.html 
https://github.com/awsdocs/aws-doc-sdk-examples/tree/master/javav2/example_code/ses 

AWS SDK for Java, version 2:

https://docs.aws.amazon.com/sdk-for-java/index.html

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_ID and AWS_SECRET_ACCESS_KEY (RECOMMENDED since they are recognized by all the AWS SDKs and CLI except for .NET), or AWS_ACCESS_KEY and AWS_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

Credential retrieval order

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