Skip to content

Instantly share code, notes, and snippets.

View Glutexo's full-sized avatar
🇨🇿
Wypili moją krew na hejnał

Glutexo Glutexo

🇨🇿
Wypili moją krew na hejnał
  • Frýdek, Czechia
View GitHub Profile
@Glutexo
Glutexo / stdout.log
Last active April 5, 2018 08:51
manageiq bundle exec rake update:ui fails
** override_gem: manageiq-providers-ansible_tower, [{:path=>"/Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq-providers-ansible_tower"}], caller: /Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq/bundler.d/custom.rb
** override_gem: ansible_tower_client, [{:path=>"/Users/stomsa/Vývoj/ManageIQ/Repozitáře/ansible_tower_client_ruby"}], caller: /Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq/bundler.d/custom.rb
** override_gem: manageiq-schema, [{:path=>"/Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq-schema"}], caller: /Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq/bundler.d/custom.rb
** override_gem: manageiq-ui-classic, [{:path=>"/Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq-ui-classic"}], caller: /Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq/bundler.d/custom.rb
bower manageiq-ui-components#bower-dev not-cached https://github.com/ManageIQ/ui-components.git#bower-dev
bower manageiq-ui-components#bower-dev resolve https://github.com/ManageIQ/ui-components.git#bower-dev
bower jquery.observ
@Glutexo
Glutexo / bash_escaped_path.rb
Created May 11, 2018 10:17
Converts non-ASCII chars of the current path to bash string entities
(File.realpath('.').each_char.map do |char| char.ascii_only? ? char : "\\u#{char.ord.to_s(16).rjust(4, '0')}" end).join
@Glutexo
Glutexo / utf8_decode_demo.rb
Created May 17, 2018 07:11
Practical demo showing manual UTF-8 decoding
# Practical demo showing manual UTF-8 decoding. Ispired by an article by Tim Bray [Characters vs.
# Bytes](http://www.tbray.org/ongoing/When/200x/2003/04/26/UTF).
# These are characters mentioned in the article. Their UTF-8 represenation is written as an array of hex-encoded bytes.
utf8_chars = [
%w(26), # &
%w(D0 96), # Ж
%w(E4 B8 AD), # 中
%w(F0 90 8D 86) # 𐍆
]
@Glutexo
Glutexo / update_ui.log
Last active June 19, 2018 12:22
ManageIQ rake update:ui log
➜ manageiq git:(master) ✗ bundle exec rake update:ui
** override_gem: manageiq-ui-classic, [{:path=>"/Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq-ui-classic"}], caller: /Users/stomsa/Vývoj/ManageIQ/Repozitáře/manageiq/bundler.d/custom.rb
bower manageiq-ui-components#bower-dev not-cached https://github.com/ManageIQ/ui-components.git#bower-dev
bower manageiq-ui-components#bower-dev resolve https://github.com/ManageIQ/ui-components.git#bower-dev
bower spice-html5-bower#~1.7.2 cached https://github.com/himdel/spice-html5-bower.git#1.7.2
bower spice-html5-bower#~1.7.2 validate 1.7.2 against https://github.com/himdel/spice-html5-bower.git#~1.7.2
bower jquery.observe_field#~0.1.0 cached https://github.com/himdel/jquery.observe_field.git#0.1.0
bower jquery.observe_field#~0.1.0 validate 0.1.0 against https://github.com/himdel/jquery.observe_field.git#~0.1.0
bower angular-ui-sortable#~0.16.1 cached https://github.com/angula
@Glutexo
Glutexo / failing_tests.txt
Created June 27, 2018 11:20
insights-core failing tests in master
________________________________ test_shadowing ________________________________
def test_shadowing():
httpd1 = HttpdConf(context_wrap(HTTPD_CONF_SHADOWTEST_1, path='/etc/httpd/conf/httpd.conf'))
httpd2 = HttpdConf(context_wrap(HTTPD_CONF_SHADOWTEST_2, path='/etc/httpd/conf.d/00-z.conf'))
httpd3 = HttpdConf(context_wrap(HTTPD_CONF_SHADOWTEST_3, path='/etc/httpd/conf.d/z-z.conf'))
result = HttpdConfAll([httpd1, httpd2, httpd3])
# get_setting_list returns ALL matching data
@Glutexo
Glutexo / kiel-produce-bug-output.txt
Last active August 7, 2018 12:14
Kiel produce bug
Traceback (most recent call last):
File "/Users/Glutexo/dev/my_repo/venv/lib/python3.7/site-packages/kiel/iterables.py", line 24, in drain
yield next_item(iterable)
File "/Users/Glutexo/dev/my_repo/venv/lib/python3.7/site-packages/kiel/iterables.py", line 17, in next_item
return coll.popitem()
KeyError: 'popitem(): dictionary is empty'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
@Glutexo
Glutexo / bug.py
Created August 20, 2018 10:45
Demonstration of insights-core stdin config parse bug on Python 3
# -*- coding: UTF-8 -*-
from insights.client.client import collect
from insights.client.config import InsightsConfig
from insights.client.connection import InsightsConnection
from mock.mock import patch
def main():
with patch("insights.client.client.get_branch_info", return_value={}):
@Glutexo
Glutexo / app.py
Last active August 28, 2018 08:51
Kiel consume bug
# This is a simple tornado application that produces to and consumes from a single
# Kafka topic. It works as follows:
# * inputer is fired whenever new data are entered to stdin. Assumes that this
# data is in JSON format. Decodes them and puts them on a local produce_queue.
# * producer connects to Kafka and watches for new items to appear in a local
# produce_queue. Produces those items to Kafka.
# * consumer connects to Kafka and reads messages from it. It does nothing with
# them, just retrieving them to demonstrate the bug.
#
# Usage:
@Glutexo
Glutexo / .xonshrc
Last active January 21, 2022 13:32
My .xonshrc, to make my life better
# Prevent warning caused by upgrade to Python 3.10.
# See https://github.com/xonsh/xonsh//issues/4409.
import warnings
warnings.filterwarnings(
'ignore',
message='There is no current event loop',
category=DeprecationWarning,
module='prompt_toolkit',
)
@Glutexo
Glutexo / open-pgadmin-4.rb
Created April 1, 2019 09:52
Open PgAdmin 4
#!/usr/bin/env ruby
=begin
PgAdmin 4 runs on a random port. Once you close its browser window, there
is no way to get back to it. But it stores its address in a hidden file.
This script finds the file and opens the address inside in a default
browser.
=end
path = File::expand_path('~')