Skip to content

Instantly share code, notes, and snippets.

View evgeni's full-sized avatar
😺
Ceci n'est pas un maintainer

Evgeni Golov evgeni

😺
Ceci n'est pas un maintainer
View GitHub Profile
@evgeni
evgeni / 01-liberation.conf
Created June 22, 2020 07:18
~/.config/fontconfig/conf.d/01-liberation.conf
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<alias>
<family>Liberation Sans</family>
<default>
<family>sans-serif</family>
</default>
</alias>
<alias>
@evgeni
evgeni / 0001-move-duplicated-code-to-module_utils.patch
Created October 17, 2018 14:15
0001-move-duplicated-code-to-module_utils.patch
From 81fc9955fd1c1410432fcd75c845479882f68e75 Mon Sep 17 00:00:00 2001
From: Evgeni Golov <evgeni@golov.de>
Date: Wed, 17 Oct 2018 16:11:28 +0200
Subject: [PATCH] move duplicated code to module_utils
---
obal/data/ansible.cfg | 1 +
obal/data/module_utils/obal.py | 21 ++++++++++++++++++
obal/data/modules/changelog.py | 12 ++--------
obal/data/modules/rpmspec_changelog_check.py | 23 +-------------------
@evgeni
evgeni / hardware.md
Last active June 9, 2018 11:12
Hardware

Motorola Xoom (MZ601)

  • UMTS
  • Netzteil
  • Speaker HD Dock + Netzteil
  • Lederhülle

Linksys WRT54G-D2

Netgear WG511T

  • 108 Mbps Wireless PC Card, PCMCIA
@evgeni
evgeni / false.txt
Last active March 6, 2018 09:35
truly false
$ ansible-playbook false.yml -e something_is_false=False
PLAY [localhost] ***************************************
TASK [debug] *******************************************
skipping: [localhost]
TASK [debug] *******************************************
skipping: [localhost]
@evgeni
evgeni / bool.txt
Last active March 6, 2018 09:02
to bool or not to bool
% ansible-playbook to_bool_or_not_to_bool.yml -e false_lower=false -e false_upper=False -e true_lower=true -e true_upper=True
PLAY [localhost] ******************************************************************************************
TASK [debug] **********************************************************************************************
ok: [localhost] => (item=false_lower) => {
"changed": false,
"false_lower": "false",
"item": "false_lower"
}
require 'puppet_forge'
require 'semantic_puppet'
require 'yaml'
require 'uri'
FILENAME = ['.fixtures.yaml', '.fixtures.yml'].find { |filename| FileTest.exists? filename }
def find_version(name, puppet)
mod = PuppetForge::Module.find name.gsub('/', '-')
mod.releases.each do |release|
#!/usr/bin/env python3
# works fine on python2 ;-)
#
# Python2 had a `commands` module, which was long deprecated, but had a nice
# shorthand to get both the status and the output of a command:
# getstatusoutput [py2doc]
# This got ported to Python3's `subprocess` module [py3doc].
#
# Both versions prented: "The exit status for the command can be interpreted
# according to the rules for the C function wait()." [wait]
from rest_framework import permissions
class IsAuthenticatedDD(permissions.BasePermission):
"""
Allows access only to authenticated users who are DDs.
Based on IsAuthenticated
https://github.com/encode/django-rest-framework/blob/master/rest_framework/permissions.py#L44
"""
def has_permission(self, request, view):
### Keybase proof
I hereby claim:
* I am evgeni on github.
* I am evgeni (https://keybase.io/evgeni) on keybase.
* I have a public key whose fingerprint is C575 A957 E819 BA18 BF07 E766 A1B0 9B42 3339 61E8
To claim this, I am signing this object:
Facter.add(:disks) do
confine :kernel => :linux
setcode do
disks = []
Dir.glob("/sys/block/*/device").each do |d|
d = d.split('/')[3]
if File.open('/sys/block/%s/removable' % d).readline.strip == '0'
disks.push(d)
end
end