VMWare Fusion 13 is now released. Read Vagrant and VMWare Fusion 13 Player on Apple M1 Pro for the latest.
This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated
VMWare Fusion 13 is now released. Read Vagrant and VMWare Fusion 13 Player on Apple M1 Pro for the latest.
This document summarizes notes taken while to make the VMWare Tech preview work on Apple M1 Pro, it originated
from keras.layers import LSTM, Dense, RepeatVector, TimeDistributed | |
from keras.models import Sequential | |
class LSTM_Autoencoder: | |
def __init__(self, optimizer='adam', loss='mse'): | |
self.optimizer = optimizer | |
self.loss = loss | |
self.n_features = 1 | |
def build_model(self): |
{ | |
"python": { | |
"library": "import json\ndef black_reformat(cell_text):\n import black\n import re\n cell_text = re.sub('^%', '#%#', cell_text, flags=re.M)\n try:\n reformated_text = black.format_str(cell_text, 88)\n except TypeError:\n reformated_text = black.format_str(cell_text, mode=black.FileMode(line_length=88))\n return re.sub('^#%#', '%', reformated_text, flags=re.M)", | |
"prefix": "print(json.dumps(black_reformat(u", | |
"postfix": ")))" | |
}, | |
"r": { | |
"library": "library(formatR)\nlibrary(jsonlite)", | |
"prefix": "cat(toJSON(paste(tidy_source(text=", | |
"postfix": ", output=FALSE)[['text.tidy']], collapse='\n')))" |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
From KERAS package | |
Fairly basic set of tools for real-time data augmentation on image data. | |
Can easily be extended to include new transformations, | |
new preprocessing methods, etc... | |
""" |
from channels.auth import AuthMiddlewareStack | |
from rest_framework.authtoken.models import Token | |
from django.contrib.auth.models import AnonymousUser | |
from django.db import close_old_connections | |
class TokenAuthMiddleware: | |
""" | |
Token authorization middleware for Django Channels 2 | |
""" |
If you want to SSH to a VPS which is running openVPN do the following:
source: https://serverfault.com/questions/659955/allowing-ssh-on-a-server-with-an-active-openvpn-client
The problem is that the default gateway gets changed by OpenVPN, and that breaks your current SSH connection unless you set up appropriate routes before you start OpenVPN.
What follows works for me. It uses iptables and ip (iproute2). Below, it is assumed that the default gateway interface before OpenVPN is started is "eth0". The idea is to ensure that when a connection to eth0 is made, even if eth0 is not the default gateway interface anymore, response packets for the connection go back on eth0 again.
You could use the same number for the connection mark, firewall mark and routing table. I used distinct numbers to make the diffences between them more apparent.