Skip to content

Instantly share code, notes, and snippets.

View pol's full-sized avatar

pol llovet pol

View GitHub Profile
@pol
pol / disasm.yml
Last active December 19, 2015 19:18
Disasm Ansible Help
---
- hosts: production
sudo: yes
tasks:
- name: add domain to hosts file
template: src=templates/hosts.j2 dest=/etc/hosts
- name: ensure apt cache is up to date
apt: update_cache=yes
- name: Install All The Packages!
apt: pkg={{item}}
@pol
pol / minecraft.yml
Last active January 17, 2023 18:16
Minecraft Ansible Playbook
#
# Minecraft Server Ansible Playbook
#
# Author:: Pol Llovet (<[email protected]>)
# Copyright 2013, Montana State University
#
# 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
#
@pol
pol / ansible-log
Created April 26, 2013 18:04
Ansible user module problem
TASK: [add RCG users as sudoers] **********************************************
<voeis-dev.rcg.montana.edu> ESTABLISH CONNECTION FOR USER: pol on PORT 22 TO voeis-dev.rcg.montana.edu
<voeis-dev.rcg.montana.edu> EXEC /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-1366999176.44-9546560642247 && chmod a+rx $HOME/.ansible/tmp/ansible-1366999176.44-9546560642247 && echo $HOME/.ansible/tmp/ansible-1366999176.44-9546560642247'
<voeis-dev.rcg.montana.edu> REMOTE_MODULE user name="pol" group="users" comment="Pol Llovet" password="----SNIP----" uid="31382" shell="/bin/zsh" home="/home/pol"
<voeis-dev.rcg.montana.edu> PUT /var/folders/lg/_rds9m6n12l5gkn5xgl6kpsm0000gn/T/tmpK1RZcZ TO /home/pol/.ansible/tmp/ansible-1366999176.44-9546560642247/user
<voeis-dev.rcg.montana.edu> EXEC /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=yyfrjqioelymraextrpmhwmpufqoijpl] password: " -u root /bin/sh -c '"'"'/usr/bin/python /home/pol/.ansible/tmp/ansible-1366999176.44-9546560642247/user'"'"''
changed: [voeis-dev.rcg.mont
@pol
pol / hosts
Last active December 16, 2015 07:29
Sorting out ansible group variable trumping
[base]
host1
host2
host3
[base:vars]
ansible_ssh_user=admin
[legacy]
host1
#!/bin/bash
getstats="/usr/share/cacti/site/scripts/getd2lstats.pl"
logfile="/var/log/syslog"
grep slapd /var/log/syslog | perl ${getstats} | sort | uniq -c | xargs | while read a b c d; do printf "$b:$a $d:$c"; done;
@pol
pol / gist:3644543
Created September 5, 2012 20:51
chef template causes restart if unchanged
template "#{node[:redmine][:root]}/current/config/configuration.yml" do
source "configuration.yml.erb"
owner "rails"
group "users"
mode "0755"
notifies :restart, resources(:service => "apache2")
variables(
:default => node[:redmine][:config][:default],
@pol
pol / Apache conf file
Created August 17, 2012 20:47
Redmine.pm is just not working
<VirtualHost *:80>
ServerAdmin [email protected]
ServerName forge.rcg.montana.edu
#Force redirection to SSL Forge site
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</VirtualHost>
+------------------------------------------------------------------------------+
[2012-07-22 19:44:31.173858] I [rpc-clnt.c:1536:rpc_clnt_reconfig] 0-store-client-1: changing port to 24009 (from 0)
[2012-07-22 19:44:31.174011] I [rpc-clnt.c:1536:rpc_clnt_reconfig] 0-store-client-0: changing port to 24013 (from 0)
[2012-07-22 19:44:35.116989] I [client-handshake.c:1090:select_server_supported_programs] 0-store-client-1: Using Program GlusterFS 3.2.5, Num (1298437), Version (310)
[2012-07-22 19:44:35.117232] I [client-handshake.c:913:client_setvolume_cbk] 0-store-client-1: Connected to 153.90.203.11:24009, attached to remote volume '/mnt/live'.
[2012-07-22 19:44:35.117261] I [afr-common.c:3141:afr_notify] 0-store-replicate-0: Subvolume 'store-client-1' came back up; going online.
[2012-07-22 19:44:35.117552] I [client-handshake.c:1090:select_server_supported_programs] 0-store-client-0: Using Program GlusterFS 3.2.5, Num (1298437), Version (310)
[2012-07-22 19:44:35.117900] I [client-handshake.c:913:client_setvo
ubag = node[:uberuser][:userdatabag]
gbag = node[:uberuser][:groupdatabag]
rails_user = data_bag_item(ubag, 'rails')
# Add the current developer ssh keys to the rails uberuser authkeys
developers = data_bag_item(gbag, 'developers')['users']
log("@@rails_rcg:default developers: #{developers.inspect}") { level :debug }
ssh_keys = developers.map{|d| data_bag_item(ubag, d)['ssh-keys'] }.flatten.compact
@pol
pol / sc-dl.js
Created March 5, 2012 23:29 — forked from pheuter/sc-dl.js
Bookmarklet that generates download link for a Soundcloud upload
(function(d) {
var dl = d.createElement('a');
dl.innerText = 'Download MP3';
dl.href = "http://media.soundcloud.com/stream/"+d.querySelector('#main-content-inner img[class=waveform]').src.match(/\.com\/(.+)\_/)[1];
dl.download = d.querySelector('em').innerText+".mp3";
d.querySelector('.primary').appendChild(dl);
dl.style.marginLeft = '10px';
dl.style.color = 'red';
dl.style.fontWeight = 700;
})(document);