To get the available images
curl -w '\n' -H "Authorization: Bearer $TOKEN" https://api.digitalocean.com/v2/images?per_page=999 | python -m json.tool > /tmp/images.json| import paramiko | |
| k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem") | |
| c = paramiko.SSHClient() | |
| c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
| print "connecting" | |
| c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k ) | |
| print "connected" | |
| commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ] | |
| for command in commands: | |
| print "Executing {}".format( command ) |
| import paramiko | |
| k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem") | |
| c = paramiko.SSHClient() | |
| c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
| print "connecting" | |
| c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k ) | |
| print "connected" | |
| commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ] | |
| for command in commands: | |
| print "Executing {}".format( command ) |
To get the available images
curl -w '\n' -H "Authorization: Bearer $TOKEN" https://api.digitalocean.com/v2/images?per_page=999 | python -m json.tool > /tmp/images.jsonPeople
:bowtie: |
😄 :smile: |
😆 :laughing: |
|---|---|---|
😊 :blush: |
😃 :smiley: |
:relaxed: |
😏 :smirk: |
😍 :heart_eyes: |
😘 :kissing_heart: |
😚 :kissing_closed_eyes: |
😳 :flushed: |
😌 :relieved: |
😆 :satisfied: |
😁 :grin: |
😉 :wink: |
😜 :stuck_out_tongue_winking_eye: |
😝 :stuck_out_tongue_closed_eyes: |
😀 :grinning: |
😗 :kissing: |
😙 :kissing_smiling_eyes: |
😛 :stuck_out_tongue: |
| public static void main(String[] args) throws Exception { | |
| final Key key = generateSymmetricKey("SecretKey".getBytes()); | |
| // encrypting | |
| final Cipher cEncrypter = Cipher.getInstance("DESede/ECB/PKCS7Padding"); | |
| cEncrypter.init(Cipher.ENCRYPT_MODE, key); | |
| final ByteArrayOutputStream bos = new ByteArrayOutputStream(); | |
| try( | |
| CipherOutputStream encrypterStream = new CipherOutputStream(bos, cEncrypter); |
| package controller | |
| func init(){ | |
| Get("/", func(w http.ResponseWriter, r *http.Request){ | |
| fmt.Fprintf(w, "%s", "Hi!") | |
| }) | |
| } |
| /* | |
| * To change this template, choose Tools | Templates | |
| * and open the template in the editor. | |
| */ | |
| package asn.helpers; | |
| /** | |
| * | |
| * @author asn | |
| */ |
| <html> | |
| <head> | |
| <meta http-equiv="content-type" content="text/html; charset=UTF-8"> | |
| <meta name="robots" content="noindex, nofollow"> | |
| <meta name="googlebot" content="noindex, nofollow"> | |
| <link rel="stylesheet" type="text/css" href="https://rawgit.com/iamceege/tooltipster/4.2.5/dist/css/tooltipster.bundle.min.css"> | |
| <link rel="stylesheet" type="text/css" href="https://rawgit.com/louisameline/tooltipster-follower/0.1.5/dist/css/tooltipster-follower.min.css"> | |
| <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.js"></script> | |
| <script type="text/javascript" src="https://rawgit.com/iamceege/tooltipster/4.2.5/dist/js/tooltipster.bundle.min.js"></script> | |
| <script type="text/javascript" src="https://rawgit.com/louisameline/tooltipster-follower/0.1.5/dist/js/tooltipster-follower.min.js"></script> |
| import java.util.ArrayList; | |
| import java.util.Collection; | |
| import java.util.Collections; | |
| import java.util.List; | |
| /** | |
| * Reference: https://stackoverflow.com/questions/19688235/how-to-implement-pagination-on-a-list | |
| * @author elvis | |
| * @version $Revision: $<br/> | |
| * $Id: $ |