apt-get update && apt-get upgrade -y
- Setting up hostname, skip if done with installation
pico /etc/hosts
| # Package generated configuration file | |
| # See the sshd_config(5) manpage for details | |
| # What ports, IPs and protocols we listen for | |
| Port 22 | |
| # Use these options to restrict which interfaces/protocols sshd will bind to | |
| #ListenAddress :: | |
| #ListenAddress 0.0.0.0 | |
| Protocol 2 | |
| # HostKeys for protocol version 2 |
| library(tidyverse) | |
| # Data is downloaded from here: | |
| # https://www.kaggle.com/c/digit-recognizer | |
| kaggle_data <- read_csv("~/Downloads/train.csv") | |
| pixels_gathered <- kaggle_data %>% | |
| mutate(instance = row_number()) %>% | |
| gather(pixel, value, -label, -instance) %>% | |
| extract(pixel, "pixel", "(\\d+)", convert = TRUE) |
| import torch | |
| from torch import nn | |
| __all__ = ['FCDenseNet', 'fcdensenet_tiny', 'fcdensenet56_nodrop', | |
| 'fcdensenet56', 'fcdensenet67', 'fcdensenet103', | |
| 'fcdensenet103_nodrop'] | |
| class DenseBlock(nn.Module): |
| #!/bin/bash | |
| # https://developer.ibm.com/answers/questions/462237/error-groot-must-be-grub-root-device-on-ubuntu/ | |
| sed -i -e 's/LABEL=cloudimg-rootfs/(hd0)/' /boot/grub/menu.lst | |
| apt-get update > /dev/null | |
| apt-get install unattended-upgrades -y | |
| timeout 20m unattended-upgrade | |
| apt-get autoremove -y | |
| apt-get autoclean -y |
| #!/bin/bash | |
| apt-get update | |
| apt-get upgrade -y | |
| apt-get autoremove -y | |
| apt-get autoclean -y | |
| apt-get install ufw -y | |
| apt-get install denyhosts -y | |
| # Configure firewall |
| { | |
| "defaultAction": "SCMP_ACT_ERRNO", | |
| "architectures": [ | |
| "SCMP_ARCH_X86_64", | |
| "SCMP_ARCH_X86", | |
| "SCMP_ARCH_X32" | |
| ], | |
| "syscalls": [ | |
| { | |
| "name": "accept", |
| __=2;print(1/( | |
| - ~ - ~ - ~ - ~ - ~ - ~ - ~ - | |
| ~ __/ ~ - ~ - ~ - ~ - ~ - ~ - ~ | |
| - __/ - ~ - __/ - ~ __/ ~ - __/__/ ~ - | |
| ~ __/ ~ - ~ __/ ~ - __/ - ~ - ~ __/ ~ | |
| - __/ - ~ - __/ - ~ __/ ~ - __/__/__/ - | |
| ~ __/ ~ - ~ __/ ~ - __/ - __/ - ~ __/ ~ | |
| - __/__/__/__/ ~ __/__/__/ ~ - __/__/__/ - | |
| ~ - ~ - ~ - ~ - ~ - ~ - ~ - ~ |
| import numpy as np | |
| from keras.models import Sequential | |
| from keras.layers.core import Activation, Dense | |
| training_data = np.array([[0,0],[0,1],[1,0],[1,1]], "float32") | |
| target_data = np.array([[0],[1],[1],[0]], "float32") | |
| model = Sequential() | |
| model.add(Dense(32, input_dim=2, activation='relu')) | |
| model.add(Dense(1, activation='sigmoid')) |
| --[[ | |
| Create a binary tree using two ways: NN containers and nn.gModule containers. | |
| This example is fairly simple, and the default fully-connected layers are all | |
| of size 100. However, this should also be simple to modify to allow different | |
| fc layers with varying inputs/outputs if desired (for example: input a table | |
| storing input+output configuration values for each of the sub-branch's level). | |
| ]] | |
| require 'nn' | |
| require 'nngraph' |