ssh -i private_key user@remote_host -L local_port:remote_host:remote_port -f -N
scp file user@IP:/dir/to/write/to
ssh -D127.0.0.1:1080 vagrant@localhost -p 2222
ssh into a running docker container
sudo docker exec -i -t 665b4a1e17b6 bash #by ID
Removes all the exited containers.
docker rm $(docker ps -q -f status=exited)
Get logfile for a container:
Java Print Method name //This is really dirty, but works, do not use this for production code, just for testing purposes.
public String getCurrentMethodName() {
StackTraceElement stackTraceElements[] = (new Throwable()).getStackTrace();
return stackTraceElements[1].toString();
}
Oracle SQL distinct on single column
select *
from TABLE_NAME
where rowid in
(
select max(ROWID)
from TABLE_NAME
GROUP BY COLUMN_NAME
Passing parameters when starting an Activity from http://stackoverflow.com/questions/2091465/how-do-i-pass-data-between-activities-in-android
Intent intent = new Intent(getBaseContext(), NameOfActivity.class);
intent.putExtra("PARAMNAME", param);
startActivity(intent);