Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
MYDNS="8.8.8.8"
DATE=$(date '+%Y-%m-%d')
UBUNTU1_URL="http://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img"
UBUNTU2_URL="http://cloud-images.ubuntu.com/bionic/current/bionic-server-cloudimg-amd64.img"
CIRROS_URL="http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img"
CENTOS_URL="http://cloud.centos.org/centos/7/images/CentOS-7-x86_64-GenericCloud.qcow2c"
VOLUME_SIZE=10
NEW_VOLUME_SIZE=15
VOLUME_NAME=$(cat /proc/sys/kernel/random/uuid)
@JamesOBenson
JamesOBenson / create_openstack_user.sh
Last active March 25, 2021 12:26
Create openstack project/user/networking & update security rules (python-openstackclient & openssl are the only requirement ); Verified all commands work properly & as intended.
#!/bin/bash
# This script creates all necessary components to start booting VM's in openstack. This includes
# - Project
# - User
# - Networking, subnets, router,
# Security group allows
# - 22 (SSH)
# - IMPI (Ping test)
# - 8443 & 8883 (Greengrass rules)
@0x4D31
0x4D31 / beautiful_idiomatic_python.md
Last active April 19, 2024 09:17 — forked from JeffPaine/beautiful_idiomatic_python.md
[Beautiful Idiomatic Python] Transforming Code into Beautiful, Idiomatic Python #python

Transforming Code into Beautiful, Idiomatic Python

Notes from Raymond Hettinger's talk at pycon US 2013 video, slides.

The code examples and direct quotes are all from Raymond's talk. I've reproduced them here for my own edification and the hopes that others will find them as handy as I have!

Looping over a range of numbers

for i in [0, 1, 2, 3, 4, 5]:
@macournoyer
macournoyer / Output
Last active January 9, 2023 15:12
A Neural Network framework in 25 LOC
$ python xor.py
Training:
Epoch 0 MSE: 1.765
Epoch 100 MSE: 0.015
Epoch 200 MSE: 0.005
* Target MSE reached *
Evaluating:
1 XOR 0 = 1 ( 0.904) Error: 0.096
0 XOR 1 = 1 ( 0.908) Error: 0.092
1 XOR 1 = 0 (-0.008) Error: 0.008
@SEJeff
SEJeff / README.md
Last active August 31, 2021 14:55
Python learnings
  1. Learn Python the Hard Way - Great introductory course to python and programming
  2. The Python Guide - After you have a cursory idea of python, this is great
  3. Code Like a Pythonista: Idiomatic Python - For learning the "pythonic" way of doing things
  4. Tango with Django - Great intro to building python web applications
  5. Intro to Flask, TDD, and jQuery
  6. Selenium's Page Object Pattern for testing websites
  7. The Python Yield Keyword Explained - Good precursor to the generator tricks
  8. Incredible guide on Python's __ (underscore) methods - Must read for anyo