Motivation: I wrote this script because my need is to have a perfect copy of my local files into my iCloud space and so far I haven't found a real good solution to do this. In fact, other solutions suggest you to create a symbolic link from the folder into iCloud to your local FS. Personally I don't like this solution. So, I decided to write this bash script that checks if a file has been modified and eventually it syncs the folder with the iCloud space.
I tested this script ONLY into Max Os and my script uses fswatch and rsync to work. To install fswatch into Mac Os you can use Brew:
brew install fswatch
Then, edit the script with a texteditor and edit the root folder that you want to sync, e.g., "/home/Pippo/Documents/".
folderToSync="WRITE HERE THE FULL PATH OF THE FOLDER TO SYNC"Important: keep the quotes "...".
Now, you can run the script dropToiCloud.sh from the terminal. Be, sure that you run the script from the same path where the script is located.
From this moment on the script is running on background. Remember that the script mirrors the folder only if a file is modifed into the folder that you specified. So, to mirror the folder for the first time you need to modify something in the selected directory, i.e., folderToSync folder.
Note that the folder is mirrored into iCloud/myCloudBox. You have to manually create the folder myCloudBox under iCloud space. You can kill the script doing from terminal.
killall -9 fswatch
VERY IMPORTANT: I wrote this script during my spare time, so it isn't bullet-proof (but it works) and to avoid having permantently deleted your file, test it before on a test-folder. So, I do not assume any responsability in case of files-lost :)
VERY IMPORTANT 2: Remeber to create a folder named "myCloudBox" into your iCloud space.
Please write me if you find some bugs and/or improve the script.
1) Create the server private key with the command:
openssl genrsa -out key_name.key 2048
2) Create a certificate request to give to the CA to get the server certificate with the command:
openssl req -out REQUEST_NAME.csr -key key_name.key -new -sha256It will give you a certificate request that you have to send to the CA to get the certificate. Then, the CA provides you the certificate for your server and the CA_chain.
3) Export the certifcate into p12 format:
openssl pkcs12 -export -in CertName.crt -inkey CertKey.key \ -out CertNameOut.p12 -name tomcat -CAfile CA_Chain.crtWhere, CA_Chain.crt is the file given by your CA when you got your certificate.
4) Finally, import everything into the keystore (it will be created now):
keytool -importkeystore -deststorepass passHere -destkeystore keystoreName.jks \ -srckeystore CertName.p12 -srcstoretype PKCS12
5) On Jboss configuration file standalone-full.xml, which it should be under /jbossFOLDER/standalone/configuration, under the line:
<connector name="http" protocol="HTTP/1.1" scheme="http" socket-binding="http"/>
add the https connector:
<connector name="https" protocol="HTTP/1.1" scheme="https" socket-binding="https" secure="true"> <ssl name="ssl" certificate-key-file="KEYSTORE_PATH.jks" password="KEYSTORE_PASSWORD.jks" protocol="TLSv1" /> </connector>KEYSTORE_PATH.jks is the path of the keystore file in your server, while KEYSTORE_PASSWORD.jks is its password.
6) Now, reboot Jboss with
sudo service jbossas7 restart
and try to connect:
https://SERVER_IP:8443Done.. If everything goes right you should see the JBoss homepage using https connection.
1) Install pip through the package manager for your system::
sudo easy_install pip
2) Now we install the clients (keystone, glance, heat, nova, neutron, cinder, swift and the new OpenStack client):
sudo pip install python-keystoneclient python-novaclient python-heatclientIt will give you a certificate request that you have to send to the CA to get the certificate. Then, the CA provides you the certificate for your server and the CA_chain.
python-swiftclient python-neutronclient python-cinderclient python-glanceclient python-openstackclient
3) Now, everything should go but if you get "Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?" or ImportError: No module named xmlrpc_client do the following:
sudo pip install --upgrade distribute
sudo pip uninstall six
Please backup your files first to proceed with the following commands
sudo rm -rf /Library/Python/2.7/site-packages/six*
sudo rm -rf /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six*
sudo pip install six
Finally, it should work! :).