Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am ledakis on github.
* I am tledakis (https://keybase.io/tledakis) on keybase.
* I have a public key ASAQS2jeB8450KiMvyeWFBBH18ODQAEQmKEJqKdGUJTBigo
To claim this, I am signing this object:
@ledakis
ledakis / main.tf
Created July 7, 2020 17:38
Check if a certificate validation record in Route 53 already exists before plan
variable "zoneid" {
type = string
default = "YOURZONEID"
}
variable "certificate_url" {
type = string
default = "fqdn.example.com."
}
@ledakis
ledakis / terraform_github_keys_list.tf
Created July 3, 2020 16:02
Gets your keys from github and makes them a list. Handy for cloud-init templates
data "http" "github-keys" {
url = "https://github.com/ledakis.keys"
}
output "keys" {
value = compact(split("\n",data.http.github-keys.body))
}
@ledakis
ledakis / update_code.sh
Last active May 19, 2020 12:46
I have set up my own code-server (https://github.com/cdr/code-server) and the auto update fails, so here is a script to pull the latest x64 release and install it.
#!/usr/bin/env bash
set -e
INSTALL_DIR="/usr/lib/code-server/"
echo Install dir: $INSTALL_DIR
temp_dir=$(mktemp -d)
old_dir=$(pwd)
cd $temp_dir

Keybase proof

I hereby claim:

  • I am ledakis on github.
  • I am tledakis (https://keybase.io/tledakis) on keybase.
  • I have a public key ASDrxyrbKlHwMcp9i6GdolWr6oagiKUVcigXUUtbVwHV6Qo

To claim this, I am signing this object:

@ledakis
ledakis / README-Template.md
Created March 29, 2017 09:21 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@ledakis
ledakis / split.py
Last active April 19, 2017 10:33
Return character/index of a string
#!/usr/bin/env python3
# Returns the position in the string of a character
# made this because I used a generated passphrase
# on my bank's website and keeps asking me which
# is the 15th character and it is so annoying :)
# Not special, just outputs the thing, not optimised.
line1=line2="|"
newline="\n"
@ledakis
ledakis / getting-started.md
Created November 11, 2016 16:05 — forked from joepie91/getting-started.md
Getting started with Node.js

"How do I get started with Node?" is a commonly heard question in #Node.js. This gist is an attempt to compile some of the answers to that question. It's a perpetual work-in-progress.

And if this list didn't quite answer your questions, I'm available for tutoring and code review! A donation is also welcome :)

Setting expectations

Before you get started learning about JavaScript and Node.js, there's one very important article you need to read: Teach Yourself Programming in Ten Years.

Understand that it's going to take time to learn Node.js, just like it would take time to learn any other specialized topic - and that you're not going to learn effectively just by reading things, or following tutorials or courses. Get out there and build things! Experience is by far the most important part

@ledakis
ledakis / digits.py
Created June 9, 2015 09:58
Python digit counter
#This will count the digits of a number.
#I tried to use mathematics instead of string length.
#I belive it *has* to do it faster, because it will
#only run k times instead of n, where k=length.
#Without having checked how str() works I expect
#they use more loops, thus more computational time.
#Disclaimer: it works with integers at the moment.
#Will have to make it better in the future.
<!DOCTYPE html>
<html>
<head>
<title>Simple Form Validation</title>
<script>
window.onload = function() {
console.log('onLoad');
var form = document.forms.register;
form.onsubmit = function() {
console.log('onSubmit');