docker run -d --name mongo -p 27017:27017 -v ~/mongo-data:/data/db mongo --auth
docker ps
PID=`lsof -i :3000 | cut -c 8-13 | grep -v "PID" | head -n 1 | tr -d '[:space:]'` | |
[ -z "$PID" ] && echo "Composer REST Server not running on port 3000" || echo "Killing $PID" | |
[ -z "$PID" ] && echo "Nothing to kill!" || kill $PID |
#!/usr/bin/expect -f | |
spawn su - hyperuser | |
expect "Password:" | |
send "<hyperuser-password>\r"; | |
expect "hyperuser$" | |
send "cd ~/fabric-tools; ls\r" | |
expect "hyperuser$" | |
send "/home/hyperuser/fabric-tools/fabricUtil.sh start\r" | |
expect "hyperuser$" | |
send "echo HLF Containers started\r" |
#!/bin/sh | |
first=`docker ps | grep "dev-peer0" | cut -c1-12 | head -n 1` | |
echo "Latest container: $first" | |
rest=`docker ps | grep "dev-peer0" | cut -c1-12 | grep -v $first` | |
echo "Stopped containers: " | |
docker stop $rest | |
echo "Removed containers: " | |
docker rm $rest |
Use the following commands or follow the installing pre-requisites guide to prep the environment for Hyperledger Fabric installation.
curl -O https://gist.githubusercontent.com/skarlekar/6cab70ee0d8cecf60d66f9beabd40acf/raw/fb976b2986e2d2e59aa4ea8caf8f10016e85af41/prereqs-ubuntu.sh
chmod u+x prereqs-ubuntu.sh
Next run the script to install the pre-requisites.
python -m json.tool my_json.json |
# Reference: https://github.com/christianbaun/ossperf/wiki/Minio-on-a-Raspberry-Pi-3-with-Raspbian-(Debian-Jessie-8.0) | |
wget https://dl.minio.io/server/minio/release/linux-arm/minio | |
chmod +x minio | |
./minio server --address ":8080" /media/ssd/minio-data/ |
import numpy as np | |
# You will need to write code that will read the file passed | |
# into this function. The first line contains the column headers | |
# so you should ignore it | |
# Each successive line contians 785 comma separated values between 0 and 255 | |
# The first value is the label | |
# The rest are the pixel values for that picture | |
# The function will return 2 np.array types. One with all the labels | |
# One with all the images |
""" | |
This Python script provides a utility to compute the cosine similarity between two text sentences using the TF-IDF | |
(Term Frequency-Inverse Document Frequency) vectorization approach. | |
Key Components: | |
1. Import Statements: The script begins by importing necessary modules: | |
- TfidfVectorizer from sklearn.feature_extraction.text for converting text data into a matrix of TF-IDF features. | |
- cosine_similarity from sklearn.metrics.pairwise to compute the similarity between two vectors in the TF-IDF space. | |
- sys for accessing command-line arguments. |
You are a game designer, a prompt engineer and a excellent teacher. Your task is to teach effective prompting techniques through a game where you challenge the user to think like an artist or photographer. In each round you will generate a prompt to create and display one image without revealing the prompt that you used and ask the user to guess the prompt that you used to generate the image. It is important that you do not reveal the prompt you used. | |
Once the user enters the guess, you will generate an image based on the description provided by the user. You will then measure how closely the users guess matches the original prompt using cosine similarity. You will then generate a percentage score based on the cosine similarity score. A cosine similarity value of -1 will be 0% and a cosine similarity value of 1 will be 100%. A cosine similarity score of 0 will be 50%. The cosine similarity score ranges from -1 (completely dissimilar) to 1 (exactly the same), with values closer to 1 indicating higher simil |