Skip to content

Instantly share code, notes, and snippets.

View iokiwi's full-sized avatar
☁️
Head in the Cloud

Simon Merrick iokiwi

☁️
Head in the Cloud
View GitHub Profile
@iokiwi
iokiwi / openstack_save_sessions.sh
Last active June 23, 2021 01:07
dump openstack session to file and reload it in a new terminal window
export OS_SESSIONS_DIR=$HOME/.os_sessions
function os_save_session() {
mkdir -p $OS_SESSIONS_DIR;
if [ -z "$OS_PROJECT_NAME" ]; then
export OS_PROJECT_NAME=$(openstack project show $OS_PROJECT_ID -c name -f value);
fi
if [ -z "$OS_TOKEN" ]; then

Conferences 👀

2021

Pycon AU Online 2021 September 10th-12th
Kiwi Pycon Christchurch 2021 September 18th - 19th (TBC)
CHCon Christchurch 2021 November 5th-6th
Purplecon Wellington/Online 2021 TBC
Kawaiicon Wellington 2021 November 12th-13th
package main
import (
"fmt"
"os"
"strings"
"time"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack"
# Script for clearing all openstack environment variables.
#
# Usage:
# source reset.sh
# source reset.sh && source openrc.sh
echo "Resetting..."
unset OS_REGION_NAME
unset OS_AUTH_TOKEN
unset OS_AUTH_URL
<QuerySet [<River: Hurunui>
<QuerySet [<AccessPoint: Jollie Brook>, <AccessPoint: South Branch Bridge>, <AccessPoint: Seaward Stream Inlet>, <AccessPoint: Bottom of Maori Gully>]>
<QuerySet [<Section: Jollie Brook to South Branch Bridge>, <Section: South Branch Bridge to Seaward Stream Inlet>, <Section: Seaward Stream Inlet to Bottom of Maori Gully>]>
<QuerySet [<Run: Jollie Brook to Bottom of Maori Gully>]>
{
"python.linting.pylintCategorySeverity.refactor": "Information",
"python.analysis.logLevel": "Information",
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"python.analysis.symbolsHierarchyDepthLimit": 0,
"files.autoSave": "afterDelay",
"python.autoComplete.addBrackets": true,
"python.linting.flake8Enabled": true,
"python.pythonPath": "./venv/bin/python",
@iokiwi
iokiwi / apps.md
Last active February 5, 2020 02:49
List of usefull software which have good free teirs ideal for individuals / small team usage on a shoe string budget.

A list of SaaS/PaaS services with generous free tiers ideal for individuals and small groups on a shoestring budget.

Usage is subject to the t

Name Function Time Limited User Limited Feature Limited Restrictions
Slack Chat Can only see 10,000 most recent messages
StatusCake Endpoint Monitoring Some features limited
Trello Limited to 1 power up per board
Heroku PaaS App Hosting Limited 'compute' hours per month
openstack alarm create \
--name mytestalarm \
--type threshold \
--threshold 5.0 \
--meter-name cpu_util \
--period 60 \
--statistic avg \
--evaluation-periods 1 \
--comparison-operator gt \
--query "metadata.user_metadata.stack=string::7db79235-8cde-43f2-9cf4-6200557164e7" \
import string
k = 13
c = """Uryyb naq jrypbzr gb gur xvjvpba onqtr Chmmyr, lbh qvfpbirerq gur svefg pyhr naq unir fgnegrq gur chmmyr jryy qbar! gb unir lbhe fpber qvfcynlrq ba gur znva yrnqreobneq, abj fraq n grkg zrffntr sebz lbhe cubar gb mreb gjb frira bar mreb mreb frira gjb gjb mreb avar pbanvavat bayl ibhe ertvfgenvba vq ahzore. Qhr gb fvmr pbapreaf envfrq blre fnsrgl naq gUr cHoyvp vzntr bs gur xvjvpba betnavfngvba, gur fgbel ryrzragf bs gur punyyratr jvyy abg or gnxvat cynpr guvf lrne. ABgujvgufgnaqvat, gurer jvyy or cyragl bs sha chmmyrf uvqqra guebhtubhg gur pba naq irahr fb unir sha naq tbbq yhpx! xvaq ertneqf, zvxr. RAQ bs zrffntr qngn"""
#c = """Hello and welcome to the kiwicon badge Puzzle, you discovered the first clue and have started the puzzle well done! to have your score displayed on the main leaderboard, now send a text message from your phone to zero two seven one zero zero seven two two zero nine conaining only vour registraion id number. Due to size concerns raised oyer safety and tH
from itertools import permutations
from functools import reduce
def as_email(first_name, last_name, domain_name, full=False):
if full:
return "{}.{}@{}".format(first_name, last_name, domain_name)
else:
return "{}@{}".format(first_name, domain_name)
def domain_name_permuations(domains, r=2, accumulate=False):