Skip to content

Instantly share code, notes, and snippets.

View BindiChen's full-sized avatar

Bindi Chen BindiChen

View GitHub Profile
@BindiChen
BindiChen / box5_adjust_size.css
Created February 25, 2020 18:38
adjust triangle size
.box_5 {
width: 0;
height: 0;
margin: 100px auto;
}
.box_5 {
border-top: 120px solid red;
border-right: 60px solid transparent;
border-bottom: 60px solid transparent;
border-left: 60px solid transparent;
@BindiChen
BindiChen / box4_transparent.css
Last active February 25, 2020 18:43
box with transparent border
.box_4 {
width: 0;
height: 0;
margin: 100px auto;
}
.box_4 {
border-top: 60px solid red;
border-right: 60px solid transparent;
border-bottom: 60px solid transparent;
border-left: 60px solid transparent;
@BindiChen
BindiChen / box3_0_size.css
Last active February 25, 2020 18:43
box size set to 0
.box_3 {
width: 0;
height: 0;
margin: 100px auto;
}
.box_3 {
border-top: 60px solid red;
border-right: 60px solid lime;
border-bottom: 60px solid blue;
border-left: 60px solid yellow;
@BindiChen
BindiChen / box2_border_100.css
Last active February 25, 2020 18:44
increase border to 100px
.box_2 {
width: 50px;
height: 50px;
margin: 100px auto;
}
.box_2 {
border-top: 60px solid red;
border-right: 60px solid lime;
border-bottom: 60px solid blue;
border-left: 60px solid yellow;
@BindiChen
BindiChen / box1_border_5.css
Created February 25, 2020 18:28
CSS code for border
.box_1 {
width: 50px;
height: 50px;
margin: 100px auto;
}
.box_1 {
border-top: 5px solid red;
border-right: 5px solid lime;
border-bottom: 5px solid blue;
border-left: 5px solid yellow;
@BindiChen
BindiChen / ec2-ssh-success.sh
Created February 23, 2020 21:00
success ssh into ec2 with key pair
⇒ ssh -i EC2boxkeypair.pem [email protected]
__| __|_ )
_| ( / Amazon Linux 2 AMI
___|\___|___|
https://aws.amazon.com/amazon-linux-2/
No packages needed for security; 14 packages available
Run "sudo yum update" to apply all updates.
[ec2-user@ip-172-31-42-197 ~]$
@BindiChen
BindiChen / ec2-0644-permission-error.sh
Created February 23, 2020 20:57
Permissions 0644 for AWS EC2 keys
⇒ ssh -i EC2boxkeypair.pem [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'EC2boxkeypair.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "EC2boxkeypair.pem": bad permissions
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
@BindiChen
BindiChen / ssh-ec2-no-key.sh
Created February 23, 2020 20:53
SSH into EC2 error Permission denied
⇒ ssh [email protected]
The authenticity of host '3.8.190.210 (3.8.190.210)' can't be established.
ECDSA key fingerprint is SHA256:TCRKNQtVl0RYgvfy3RprEEKsOG2OMVta1wD1f7s3KxY.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '3.8.190.210' (ECDSA) to the list of known hosts.
[email protected]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
@BindiChen
BindiChen / test-unknow.py
Created February 20, 2020 21:13
Test if this unknown face encoding matches any of the people we know
# Test if this unknown face encoding matches any of the people we know
results = face_recognition.compare_faces(
known_face_encodings,
unknown_face_encoding,
tolerance=0.6
)
# results is a 0-based list
for num in range(0, n):
if results[num]:
@BindiChen
BindiChen / loop_over_unknown.py
Created February 20, 2020 21:07
loop over each face we found
for unknown_face_encoding in unknown_face_encodings:
face_distances = face_recognition.face_distance(
known_face_encodings,
unknown_face_encoding
)
print(f"Distance between unknown image and each known image: {face_distances}")