Skip to content

Instantly share code, notes, and snippets.

Avatar

Guillaume Coré fridim

View GitHub Profile
View keys.yaml
- hosts: localhost
gather_facts: false
vars:
bla:
keys:
- 1
- 2
tasks:
- debug:
msg: "{{ bla['keys'][0] }}"
View os-release
NAME="Red Hat Enterprise Linux Server"
VERSION="7.4 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.4"
PRETTY_NAME=OpenShift
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.4:GA:server"
View delete_vpc.sh
#!/bin/sh
#
# Delete a VPC and its dependencies
REGION=eu-central-1
REGION=us-west-2
REGION=ap-southeast-1
export AWS_PROFILE=sandbox37
export AWS_PROFILE=sandbox29
@fridim
fridim / mount_qube_volume.sh
Created Jun 3, 2019
Mount a volume inside a qube to /mnt/removable
View mount_qube_volume.sh
#!/bin/bash
if [ -z "$1" ] || [ -z "$2" ]; then
echo "${0} QUBE VOLUME"
exit 2
fi
set -xeu -o pipefail
volume=$(qvm-block | awk "/${2}/{print \$1}")
UUID=$(sudo blkid /dev/mapper/${2} -sUUID -ovalue)
View output.txt
PLAY [localhost] ******************************************************************************************************************************************************************************
TASK [set_fact] *******************************************************************************************************************************************************************************
ok: [localhost]
TASK [include_role : /tmp/testrole] ***********************************************************************************************************************************************************
TASK [/tmp/testrole : set_fact] ********************************
@fridim
fridim / mysshpassword.sh
Created Apr 20, 2018
write password even if it's a bad idea
View mysshpassword.sh
#!/usr/bin/expect
spawn ssh $argv
expect "password"
send "mypassword\n\r"
expect "$ "
interact
@fridim
fridim / i3-dmenu-desktop.patch
Last active Jun 18, 2017
add caching to i3-dmenu-desktop
View i3-dmenu-desktop.patch
--- /usr/bin/i3-dmenu-desktop 2016-11-12 13:32:44.000000000 +0100
+++ i3-dmenu-desktop 2017-06-18 02:31:25.736657222 +0200
@@ -7,7 +7,8 @@
use strict;
use warnings qw(FATAL utf8);
-use Data::Dumper;
+use Storable;
+#use Data::Dumper;
use IPC::Open2;
View block1_block2.diff
--- /tmp/2 2017-04-11 18:10:47.675418352 +0200
+++ /tmp/3 2017-04-11 18:10:58.305348455 +0200
@@ -4,7 +4,6 @@
- ^{{\s*(\w*)\s*}}$
- 32
_available_variables:
- _raw_params: ./block1.yml
ansible_accelerate_port: 5099
ansible_check_mode: false
ansible_connection: local
@fridim
fridim / block1.yml
Last active Apr 11, 2017
not working
View block1.yml
---
- block:
- name: first block
debug:
msg: "first block, first task"
listen: "first block"
when:
- test1
View blocks_in_handlers.yml
---
- name: conditionnal on blocks in handlers, false false
hosts: localhost
gather_facts: no
vars:
test1: false
test2: false
handlers:
- block:
- name: first block
You can’t perform that action at this time.