Skip to content

Instantly share code, notes, and snippets.

@t0mk
t0mk / seg2.py
Created January 20, 2021 12:29
Segment Averaging Python code
#!/usr/bin/env python3
import os
import sys
from math import sqrt
import numpy as np
import io
def read_training(d):
@t0mk
t0mk / pricePerSpotCPU.py
Last active January 20, 2020 15:40
Prints data about Spot Maket prices in Packet API: facility, plan, price per hour, number of CPU, price per CPU hour
#!/usr/bin/env python3
import os
import sys
import requests
apiToken = os.environ["PACKET_API_TOKEN"]
assert(len(apiToken))
apiUrl = "https://api.packet.net"
headers = {"X-Auth-Token": apiToken}
locals {
project_id = "408b7fd3-0df2-4837-b0df-65aaf09f642a"
ud = <<EOS
#cloud-config
coreos:
units:
- name: "docker-prometheus-node-exporter.service"
command: "start"
content: |
[Unit]
@t0mk
t0mk / helloworld.md
Created March 3, 2019 16:19
Hello World

ff

@t0mk
t0mk / main.tf
Created February 27, 2019 14:13
packet bgp with count
variable "bgp_password" {
type = "string"
default = "955dB0b81Ef"
}
variable "worker_count" {
type = "string"
default = "2"
@t0mk
t0mk / fff.md
Created November 22, 2017 14:17
rrr

fff

fds f sdf sdf sd fsd f sf ds

! 9/21/2015, 11:16:19 AM https://www.facebook.com/
www.facebook.com###stream_pagelet
! 9/21/2015, 11:16:36 AM https://www.facebook.com/
www.facebook.com###u_jsonp_9_1
! 9/21/2015, 11:16:50 AM https://www.facebook.com/
www.facebook.com###blueBarNAXAnchor > .__wu.clearfix._uaw > ._fmc > ._2gyi > ._2gyj
@t0mk
t0mk / apps.fact
Created August 31, 2015 12:43
apps fact
#!/home/core/bin/python
APP_PATH = '/apps'
CONFIG = 'config.yml'
import os
import yaml
import json
import subprocess
ssh-dss AAAAB3NzaC1kc3MAAACBAIqQWAYfwOYRouaFEPAjtQIDDvQMMni4IUS69f6gQRl6CoHBJHYXpqgaeK3HeYOLYdGtYIfy6UMuGie0W1JAXMsIDYBpuHHYed0Kou18MNiLpwihR0lKd0kM11UwPvirexLelr3RtUVTR1VQ4DvceBFCUtXFE323F8Ln0scnjhUjAAAAFQCJ/Wh36uhh/jcT66DqKgKsy4mh0wAAAIBKgPr3SfVSCyc7HG8ed4F+utjblW39sXSEQJifbjGmWB9lFu/vcAiYYGqrmZqqJl9AhK7buZ2PcbqMVL4swAeV7SQqGHf7VhDHlaaNR6sVbnDbiTMTBjq1H4SJkihK9JcIBaYakhppyLMVKb2La6BDrZPwGuZsv6ZSHXy2ESZobAAAAIBGjgIlhL+FkLZulIVVeUkaPDIp4OvKEQRiPNSU6RtZl4u5Relk4oj8bzRV6GlFnxfuzg3o/xQacMijCllSWTSBB6lrZ7G6A2QraLeoHZoubExhtcZnH5K8ekVm02Di4sS3EhGcnZ1oUSg4vzxMn73biZBAfS6/VfpjKufSLAybng== tomk@Tomass-MacBook-Pro.local
@t0mk
t0mk / ans_meetup_20141029.md
Last active August 29, 2015 14:08
Ansible Helsinki meetup 2014-10-29

Demo: To launch a few Docker containers on a virtual machine

Why: I want to have some containers running for playing with (..) (running Docker container on a VM is not the most efficient way to go, but for development it's alright)

To start with: vanilla instance of newest Ubuntu 14.04 cloud image

I use OpenStack. You can get one for free on Amazon. Probably also free tier in Rack, Euca ,...

sudo-capable SSH user, with my key in .ssh/authorized_keys