- Launch a new Command Prompt (cmd)
- Type the command diskpart
- type list disk and note the number of the APFS formatted disk
- type select disk X where X is the number noted in step 3
- type clean. Now the drive doesn’t have partitions anymore, it’s just an unallocated space.
- Type
create partition primary
- To format type
format quick fs=ntfs
- Type
assign
letter=
X
Author: aidilazhar
Google Keystore
keytool -genkey -v -keystore MY-RELEASE-KEY.keystore -alias MY_ALIAS_NAME -keyalg RSA -keysize 2048 -validity 10000 -storetype jks
keytool -v -list -keystore MAAS-RELEASE-KEY.keystore
keytool -export -rfc -keystore upload-keystore.jks -alias upload -file upload_certificate.pem
Calculate Hamming, Manhattan and Minkowski Distance
# calculate hamming distance
from math import sqrt
def hamming_distance(x, y):
return sum(abs(a1 - a2) for a1, a2 in zip(x, y)) / len(x)
# define data
rowA = [0, 1, 0, 1, 0, 1]
rowB = [0, 1, 0, 0, 1, 0]
# calculate distance
result = hamming_distance(rowA, rowB)
print(result)
# calculate manhattan distance
def manhattan_distance(x, y):
return sum(abs(a1-a2) for a1, a2 in zip(x, y))
# define data
rowA = [10, 30, 45, 10, 5]
rowB = [12, 24, 18, 8, 7]
# calculate distance
result = manhattan_distance(rowA, rowB)
print(result)
# calculate minkowski distance
def minkowski_distance(x, y, z):
return sum(abs(a1-a2)**z for a1, a2 in zip(x, y))**(1/z)
# define data
rowA = [20, 40, 25, 30, 5]
rowB = [12, 10, 18, 10, 7]
# calculate distance (z=1)
result = minkowski_distance(rowA, rowB, 1)
print(result)
# calculate distance (z=2)
result = minkowski_distance(rowA, rowB, 2)
print(result)
Convert Let’s Encrypt SSL certificates from pem to crt/key
openssl rsa -in <path_to_privkey.pem> -pubout > key.pub
openssl rsa -outform der -in privkey.pem -out privkey.key
openssl x509 -outform der -in fullchain.pem -out fullchain.crt
openssl x509 -outform der -in cert.pem -out cert.crt
openssl x509 -in cert.pem -outform pem -outform der -out cert.cer
AWS Kinesis to Redshift Python
Pagi Raya – Demo
Pagi Raya – Words and Music: M. Aidil Azhar Salim
Walk Over – Demo
Walk Over – Words and Music: M. Aidil Azhar Salim
In Light – Demo – first write
In Light – Words and Music: M. Aidil Azhar Salim
Revolution – Demo
Revolution – Words and Music: M. Aidil Azhar Salim
Harrisongs – Demo
Harrisongs – Words and Music by: M. Aidil Azhar Salim