Skip to content

Instantly share code, notes, and snippets.

View askedrelic's full-sized avatar

Matt Behrens askedrelic

View GitHub Profile
@askedrelic
askedrelic / better move
Last active August 15, 2017 08:18
Find examples #unix
# better mv
find . -name "*.symlink" -exec sh -c 'echo "$1" ".${1%.symlink}"' _ {} \;
@askedrelic
askedrelic / debugging
Created August 15, 2017 08:22
Ansible snippets
- debug: var=another_fact
- name: Perform a rot13
debug: msg="The word {{ roman_name }} becomes {{ roman_name | rot13 }}"
- name: get hostvars for servers' ansible_default_ipv4
set_fact:
ip_list1: "{{ hostvars|fetchlistfromdict(groups.servers)|map(attribute='ansible_default_ipv4.address')|list }}"
- name: turn to FOO
@askedrelic
askedrelic / trim.sh
Created August 15, 2017 08:23
Unix Trim
cut -c1-8
from flask import Flask, session
app = Flask(__name__)
app.session = dict()
@app.route('/')
def reset():
app.session["counter"]=0
@askedrelic
askedrelic / main.go
Created February 25, 2025 23:13
Waste memory
package main
import (
"fmt"
"runtime"
"time"
)
func main() {
// Store allocated memory to prevent garbage collection