Exchange issues

Problems with renewing my exchange certificate. I was getting the following error:

[PS] C:\windows\system32>Get-ExchangeCertificate
The Exchange Certificate operation has failed with an exception. The error message is: Unknown error (0xe0434f4d)
+ CategoryInfo : InvalidOperation: (:) [Get-ExchangeCertificate], LocalizedException
+ FullyQualifiedErrorId : B5063A5B,Microsoft.Exchange.Management.SystemConfigurationTasks.GetExchangeCertificate

After searching the internet there was a suggestion to start the IIS Admin service.  The service was, indeed, disabled.  Starting the service resolved the issue.

BIG IP CRYPTO Example

The big ip CRYPTO command provides an opportunity to provide secure communication between applications and the BIG IP device.

This is a simple example of using CRYPTO to communicate with OpenSSL.

Add an iRule to the big ip virtual server:

when HTTP_RESPONSE {
    set key "abed1ddc04fbb05856bca4a0ca60f21e"
    set iv "d78d86d9084eb9239694c9a733904037"
    set data "The quick brown fox"
    set enc_data [CRYPTO::encrypt -alg aes-128-cbc -keyhex $key -ivhex $iv $data]
    HTTP::header insert aes_encrypted "[b64encode $enc_data]"
}

The encrypted data can be retrieved with any utility, I use curl:

curl -D - http://site/
HTTP/1.1 200 OK
Content-Type: text/html
Date: Thu, 29 Jun 2017 13:58:01 GMT
Content-Length: 1293
aes_encrypted: cfsVbrUjPXg4ieEI3R1WsVliS5VRDJVINhMJW55whJc=

The encrypted header can be decoded with OpenSSL:

echo "cfsVbrUjPXg4ieEI3R1WsVliS5VRDJVINhMJW55whJc=" | openssl enc -d -A -a -iv d78d86d9084eb9239694c9a733904037 -K abed1ddc04fbb05856bca4a0ca60f21e -aes-128-cbc -nosalt
The quick brown fox

GL.iNnet GL-AR150 Wifi Pineapple

I’ve deployed the Wifi pineapple firmware on a GL-AR150, and wanted to use the second ethernet port for connecting to the Internet.

The normal configuration is to connect the controlling PC to the WAN port on the GL-AR150, this is eth0 within Wifi Pineapple. The web interface on the wifi pineapple does not appear to allow configuration of the other interface. Logging into the GL-AR150 using ssh allows configuration of eth1. I use ssh to set the IP address on eth1, which reports an error, but seems to work.

root@Pineapple:~# ifconfig eth1 192.168.1.252 255.255.255.0
ifconfig: SIOCSIFADDR: Invalid argument
root@Pineapple:~#

The default route can now be added to eth0 using the web gui.

Bridged networks can be displayed using the command:

root@Pineapple:~# brctl show
bridge name     bridge id               STP enabled     interfaces
br-lan          7fff.e4956e4061d2       no              eth0
                                                        wlan0
root@Pineapple:~#

Raspberry Pi

Pi Zero HID gadget

Setup according to https://github.com/girst/hardpass-sendHID

Test:

echo -ne "\x00\x00\x00\x38\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" > /dev/hidg0
pass test/dummy | ./scan /dev/hidg0 2 2

GY-521 accelerometer

http://blog.bitify.co.uk/2013/11/reading-data-from-mpu-6050-on-raspberry.html

Python

This is a list of useful commands related to Python.

Jupyter notebook location

When starting jupyter notebooks on Windows the shortcut defaults to my profile directory.  To get round this create a jupyter config:

jupyter notebook --generate-config

This will be located in .jupyter\jupyter_notebook_config.py within the profile directory.

Update c.FileContentsManager.root_dir to point to the folder for notebooks

Machine learning

Frequency analysis with Python https://sites.google.com/site/haskell102/home/frequency-analysis-of-audio-file-with-python-numpy-scipy

scikit-learn documentation http://scikit-learn.org/stable/user_guide.html

Azure Machine Learning documentation

Sequential data

http://web.engr.oregonstate.edu/~tgd/publications/mlsd-ssspr.pdf

Fraud detection with Azure Stream Analytics https://azure.microsoft.com/en-us/documentation/articles/stream-analytics-real-time-fraud-detection/

Streaming analytics in Python http://matthewrocklin.com/blog/work/2014/07/04/Streaming-Analytics

Anomaly detection

Azure anomaly detection

Azure One-Class Support Vector Machine