From February 2016

Bandwidth control when transfering files with sftp/scp


OpenSSH doesn’t support bandwidth control (no -l option at all)

sftp -oIdentityFile=/home/oracle/mykey-open.ppk opc@12x.14x.2x.17x

On the other hand scp does have the -l option:

scp -l 400 -i /home/oracle/mykey-open.ppk fmw_12.2.1.0.0_bpm_quickstart.jar opc@12x.14x.2x.17x:/home/opc

Please note that -l is informed in Kbits (400=50Kb/sec)

COMMENTS

Setting -l after -i didn’t work for me

Renice is not a solution

If you ant to control individual bandwidth consumption using nice don’t loose your time, scheduler is far complex than that

[root@wcp12cr2 ~]# pgrep scp

3176
3181
[root@wcp12cr2 ~]# renice -n -20 -p 3176
3176: old priority -20, new priority -20

But individual processes doen’t seem to be affected, true because other aspects are in place such as i/0…

Enjoy 😉

Store Files Securely in Oracle Storage Cloud Service


SCS supports encryption. With this mechanism you can store your files in SCS with an encryption key that you provide.

Here you are a java example:

package es.jmu.testscsencrypt;
import oracle.cloud.storage.*;
import java.io.*;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.SecureRandom;
import java.util.UUID;
public class TestEncrypt {
public static void main(String[] args) {
try {
Long t0 = System.currentTimeMillis();
CloudStorageConfig myConfig = new CloudStorageConfig();
myConfig.setServiceName(“Storage-0123456789”)
.setUsername(“sateloc”)
.setPassword(“obob”.toCharArray())
.setServiceUrl(“https://us2.storage.oraclecloud.com”);
// I’m creating a new keypair for each execution for simplification
// keypair should be retrieved from a keystore where it was stored previously, obvoiously!
KeyPairGenerator keyGen = KeyPairGenerator.getInstance(“RSA”);
SecureRandom random = SecureRandom.getInstance(“SHA1PRNG”, “SUN”);
keyGen.initialize(2048, random);
KeyPair kp = keyGen.generateKeyPair();
myConfig.setKeyPair(kp);
EncryptedCloudStorage es = CloudStorageFactory.getEncryptedStorage(myConfig);
System.out.println(“\nConnected!!\n”);
//open the file
File f = new File(args[0]);
Long mbs = f.length()/1024/1024;
System.out.println(“Subiendo fichero ” + args[0] + ” de tamaño ” + mbs + ” Mbytes”);
FileInputStream fis = new FileInputStream(f);
//store file up there
es.storeObject(“testencrypt”, UUID.randomUUID().toString(), “text/plain”, fis);
fis.close();
Long durasegs = (System.currentTimeMillis() – t0)/1000;
System.out.println(“Ratio transferencia: ” + mbs/durasegs + ” MB/seg”);

// at this point you can take a look to the file stored and you’ll see it is encrypted

//see figure I

// now let’s get the bytes downloaded

StorageInputStream sis = es.retrieveObject(“testencrypt”, f.getName());
byte [] churro = new byte[102400];
int l = 0;
while(l >= 0){
l = sis.read(churro);
if( l > 0 )System.out.println(new String(churro));
}

// as you can see the file is cleartext, see figure II
} catch (Exception e) {
e.printStackTrace();
}
}
}

Figure I

scsencryptI.png

Figure II

scsencryptII

Enjoy it 😉

ADAPTIVE CASE MANAGEMENT MODELING


ACM can feet in those use cases where “standard” BMP can’t describe precisely the business problem. An ACM notation (CMMN) modeling is under work and in the meantime it is published we need to provide tools that could help Customers to make life easyer. My experiences around this field are disperse but I’m compiling here a short list of common tasks and tools I’ve utilized:

– Activities are almost always well defined tasks that can be modeled with BPM

– We are not using sub-cases, the relationships between cases and dependencies are implemented using what the engine offers for that matter

– Here you are a short bunch of shapes I’ve created with my Grafio(tm) app for modeling a real use case

acm2

– And here we are an initial draft modeling real use case:

acm1
– My Customer is using WcPortal for user interface therefore we are designing custom UI for dealing with the case activities life-cycle(start/stop/suspend/resume…) and relationships between cases:

ORANGE SB HERCULES OPCION 1
Enjoy 😉