Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

16
LINES

< > BotCompany Repo | #1009982 // Test scpUpload with tinybrain.de, auto-find password (~/JavaX-Secret/*/<x>@<server>.ssh.pass) [OK]

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Uses 4887K of libraries. Click here for Pure Java version (1199L/9K/32K).

1  
!7
2  
3  
static S host = "tinybrain.de";
4  
static S user = "root";
5  
static S remotePath = "/tmp/testfile.txt";
6  
7  
p-tt {
8  
  print("Connecting to " + host + " as " + user + "...");
9  
  byte[] data = toUtf8("Hello world!");
10  
  print("Uploading to: " + remotePath);
11  
  scpUpload(user, host, remotePath, l(data), new ByteArrayInputStream(data));
12  
  print("Done! Listing...");
13  
  print(quickSSH2(user, host, "ls -l " + bashQuote(remotePath), 30));
14  
  print("Printing file");
15  
  print(quickSSH2(user, host, "cat " + bashQuote(remotePath), 30));
16  
}

Author comment

Began life as a copy of #1004834

download  show line numbers  debug dex  old transpilations   

Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1009982
Snippet name: Test scpUpload with tinybrain.de, auto-find password (~/JavaX-Secret/*/<x>@<server>.ssh.pass) [OK]
Eternal ID of this version: #1009982/4
Text MD5: a217f1e3026e0efc348c1ef448cb74a7
Transpilation MD5: 7918d1d071af08e8868fee5d350fdcb0
Author: stefan
Category: javax
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2017-08-28 01:02:29
Source code size: 538 bytes / 16 lines
Pitched / IR pitched: No / No
Views / Downloads: 557 / 611
Version history: 3 change(s)
Referenced in: [show references]