Skip to content

Instantly share code, notes, and snippets.

@fridim
fridim / tarball.sh
Last active September 28, 2015 17:28
a small script to create archive (no option, can pass a file, a folder, a link ..)
#!/bin/sh
# Most of the time, you just want a .tar.gz of a folder, regardless of
# where you are. This is a small script that does it and put the result
# in /tmp. If you have xsel installed, it copied to your clipboard the
# destination file.
set -e
file="$1"
import datetime
import os
import time
# Ansible 1.9 and 2.0 compatibility
try:
from ansible.plugins.callback import CallbackBase
parent_class = CallbackBase
except ImportError:
parent_class = object
@fridim
fridim / get.html
Last active December 8, 2016 20:53
glod-web a webservice frontend to https://github.com/dwarvesf/glod
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>download goodies!</title>
</head>
<body>
<h1>Extraction in progress ... <span id="ajaxcontent" ></span></h1>
@fridim
fridim / qr.sh
Last active December 9, 2016 11:45
#!/usr/bin/bash
qrencode "$(xsel -p)" -o /tmp/qr.png
nohup feh /tmp/qr.png && rm /tmp/qr.png &
---
- name: conditionnal on blocks in handlers, false false
hosts: localhost
gather_facts: no
vars:
test1: false
test2: false
handlers:
- block:
- name: first block
@fridim
fridim / block1.yml
Last active April 11, 2017 11:36
not working
---
- block:
- name: first block
debug:
msg: "first block, first task"
listen: "first block"
when:
- test1
--- /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 / i3-dmenu-desktop.patch
Last active June 18, 2017 00:31
add caching to i3-dmenu-desktop
--- /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;
@fridim
fridim / mysshpassword.sh
Created April 20, 2018 18:13
write password even if it's a bad idea
#!/usr/bin/expect
spawn ssh $argv
expect "password"
send "mypassword\n\r"
expect "$ "
interact
PLAY [localhost] ******************************************************************************************************************************************************************************
TASK [set_fact] *******************************************************************************************************************************************************************************
ok: [localhost]
TASK [include_role : /tmp/testrole] ***********************************************************************************************************************************************************
TASK [/tmp/testrole : set_fact] ********************************