Skip to content

Instantly share code, notes, and snippets.

@DominicBreuker
DominicBreuker / sgd.py
Last active January 6, 2020 08:51
Simple SGD example for tensorflow
import tensorflow as tf
from random import randint, seed
seed(42)
current_x = tf.placeholder(tf.float32)
x = tf.Variable(2.1, name='x', dtype=tf.float32)
log_x = tf.log(x)
result = current_x * tf.square(log_x)
@DominicBreuker
DominicBreuker / word2vec_kata.py
Created June 17, 2016 11:13
Fill in some lines of code and train your word vectors
# Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# delete all containers
docker rm $(docker ps -a -q)
# delete images without tags
docker rmi $(docker images | grep '^<none>' | awk '{print $3}')
# clean up volumnes
docker volume prune
@DominicBreuker
DominicBreuker / iptables.md
Last active October 14, 2021 17:47
iptables firewall

iptables cheat sheet

Concepts

iptables defines tables, which group features:

  • filter: use it to filter traffic
  • nat: use it to implement NAT
  • raw: use it to define which connections iptables should track (stateful firewall)
  • mangle: use it to change some fields in packets (e.g., TTL)
  • security: use it to define access control
@DominicBreuker
DominicBreuker / GnuPG.md
Created October 31, 2017 22:03
gpg gnupg encryption

GnuPG

Setup

Install:

brew install gnupg # on Mac OS
apt-get install gnupg # on Ubuntu/Debian
...