Skip to content

Instantly share code, notes, and snippets.

@t2d
t2d / main.yml
Last active June 25, 2020 20:14
ansible distribution specific vars and tasks
---
# (c) Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@t2d
t2d / gist:73b2bd51584809c4f7b751dd5faf3738
Created February 7, 2020 09:32
Remove onlyoffice-documentserver package and all it's dependencies
#!/bin/bash
supervisorctl stop ds:converter
supervisorctl stop ds:docservice
supervisorctl stop ds:gc
supervisorctl stop ds:metrics
supervisorctl stop ds:spellchecker
apt -y purge onlyoffice-documentserver
# speed up uninstall
---
- hosts: localhost
become: true
roles:
- ansible-nginx-slac
- base_goss
vars:
nginx_heading: Hello SLAC!
goss_test_directory: /etc/goss.d
### Keybase proof
I hereby claim:
* I am t2d on github.
* I am t2d (https://keybase.io/t2d) on keybase.
* I have a public key ASAlP4lf_ybwwzRKStdQ-VGT9fEoDsdbgSnXKHRp68TF4wo
To claim this, I am signing this object:
@t2d
t2d / ansible-changeonly
Created February 22, 2017 20:07
Remove skipped lines from ansible output
#!/usr/bin/awk -f
# Remove skipped lines from ansible output
# Do only print plays and tasks with changes
#
# If you want to see warning:
# ansible-playbook site.yml 2>&1 | ansible-changeonly
#
# If you don't want to see warning:
# ansible-playbook site.yml 2>/dev/null | ansible-changeonly
#
➜ iso git:(master) ✗ PACKER_LOG=1 packer build test.packer
2016/04/15 10:42:57 [INFO] Packer version: 0.10.0 0d4ee09ea5b0458d6e85a52ae82eb5add16bf6bb
2016/04/15 10:42:57 Packer Target OS/Arch: linux amd64
2016/04/15 10:42:57 Built with Go Version: go1.6
2016/04/15 10:42:57 [DEBUG] Discovered plugin: amazon-chroot = /usr/local/bin/packer-builder-amazon-chroot
2016/04/15 10:42:57 [DEBUG] Discovered plugin: amazon-ebs = /usr/local/bin/packer-builder-amazon-ebs
2016/04/15 10:42:57 [DEBUG] Discovered plugin: amazon-instance = /usr/local/bin/packer-builder-amazon-instance
2016/04/15 10:42:57 [DEBUG] Discovered plugin: digitalocean = /usr/local/bin/packer-builder-digitalocean
2016/04/15 10:42:57 [DEBUG] Discovered plugin: docker = /usr/local/bin/packer-builder-docker
2016/04/15 10:42:57 [DEBUG] Discovered plugin: file = /usr/local/bin/packer-builder-file
@t2d
t2d / cron.j2
Created January 18, 2016 16:54
#!/bin/sh
DATE=$(date --rfc-3339=date)
NAME=trusty-${DATE}
# create snapshot of each repo
{% for repo in aptly_mirrors %}
aptly mirror update {{ repo.name }}
aptly snapshot create {{ repo.name }}-${DATE} from mirror {{ repo.name }}
{% endfor %}
@t2d
t2d / magicmap.yml
Created November 13, 2014 15:29
Playbook for MagicMap in Vagrant
---
- hosts: all
tasks:
- name: Set LC_ALL
lineinfile:
dest: /etc/environment
regexp: ^LC_ALL
line: LC_ALL="en_US.utf8"
@t2d
t2d / java7.yml
Last active August 29, 2015 14:08 — forked from owainlewis/java7.yml
---
- name: ensure required packages are installed for Java 7
apt: name=$item state=latest update_cache=yes
with_items:
- python-software-properties
- name: Add Java repository to sources
action: apt_repository repo='ppa:webupd8team/java'
@t2d
t2d / Collision.java
Created June 25, 2013 19:29
Implementation of a Hash Collision with SHA512/t
import java.security.NoSuchProviderException;
import java.security.Security;
import java.security.NoSuchAlgorithmException;
import java.util.HashMap;
import java.math.BigInteger;
import org.bouncycastle.crypto.Digest;
import org.bouncycastle.crypto.digests.SHA512tDigest;
import org.bouncycastle.jce.provider.BouncyCastleProvider;
public class Collision {