Skip to content

Instantly share code, notes, and snippets.

@corvax19
corvax19 / openssh-encrypt-decrypt.txt
Last active July 28, 2023 14:10
[/linux/openSSL] Simple text #encryption/#decryption with #openssl
echo -n "That's the text"|openssl enc -e -aes-256-cbc -a
Encrypt with interactive password. Encrypted message is base64-encoded afterwards.
echo -n "That's the text"|openssl enc -e -aes-256-cbc -a -k "MySuperPassword"
Encrypt with specified password. Encrypted message is base64-encoded afterwards.
echo "GVkYiq1b4M/8ZansBC3Jwx/UtGZzlxJPpygyC"|openssl base64 -d|openssl enc -d -aes-256-cbc
Base-64 decode and decrypt message with interactive password.
echo "GVkYiq1b4M/8ZansBC3Jwx/UtGZzlxJPpygyC"|openssl base64 -d|openssl enc -d -aes-256-cbc -k "MySuperPassword"
@oillio
oillio / MyServiceImpl.java
Created October 5, 2016 20:05
bi-directional stream gRPC with RxJava
public class MyServiceImpl extends DeviceServiceGrpc.DeviceServiceImplBase {
@Override
public StreamObserver<GetLocationRequest> getLocations(StreamObserver<GetLocationResponse> responseObserver) {
RequestBridge<GetLocationRequest> request = new RequestBridge<>();
ResponseBridge response = new ResponseBridge((ServerCallStreamObserver) responseObserver);
request.map(this::doGetLocation)
.subscribe(response);
return request;
}
@mmatkinson
mmatkinson / df_to_ddl.py
Created November 4, 2016 13:39
take in a dataframe and output (redshift) DDL For creating a table of that format.
def df_to_ddl(df, tablename='test.mytable'):
data_dtypes = df.dtypes.reset_index().rename(columns = {'index':'colname',0:'datatype'})
# Map pandas datatypes into SQL
data_dtypes['sql_dtype'] = data_dtypes.datatype.astype(str).map(
{'object':'varchar(24)',
'float64':'float',
'int64':'int',
'bool':'boolean'} )
@mainvoid007
mainvoid007 / installcdo.sh
Last active November 4, 2021 15:37
install cdo with grib2, hdf5, netcdf4
#!/bin/bash
# Institut für Wetter- und Klimakommunikation GmbH / Qmet
# O. Maywald <maywald@klimagipfel.de>
# This should install CDO with grib2, netcdf and HDF5 support. Note that the binaries are in /opt/cdo-install/bin.
# For further information look:
# http://www.studytrails.com/blog/install-climate-data-operator-cdo-with-netcdf-grib2-and-hdf5-support/
# docker-command