Skip to content

Instantly share code, notes, and snippets.

View ssato's full-sized avatar

Satoru SATOH ssato

View GitHub Profile
@ssato
ssato / dnf-plugin-tracer-sample-log.txt
Created June 14, 2016 06:50
Sample output log of DNF tracer plugin
You should restart:
* Some applications using:
pulseaudio --kill; pulseaudio --start
* These applications manually:
(sd-pam)
Xorg
evolution-addressbook-factory
evolution-addressbook-factory-subprocess
evolution-calendar-factory
In [13]: sys.modules["yaml"] = None
In [14]: import anyconfig.backends
In [15]: anyconfig.backends.list_types()
Out[15]:
['bson',
'configobj',
'ini',
'json',
@ssato
ssato / auto_detect_os_and_dist_w_using_osinfo-db
Created April 11, 2017 03:29
Auto detect os and distribution w/ using osinfo-db
$ ipython
Python 2.7.13 (default, Jan 12 2017, 17:59:37)
Type "copyright", "credits" or "license" for more information.
IPython 3.2.1 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
#! /bin/bash
#
# Based on some scripts found at https://ubuntuforums.org/showthread.php?t=1813001
#
# Requirements: espeak and play (sox)
#
# Examples:
#   - cat /etc/issue | $0
#   - echo 'Danger, Robinson!' | $0
#   - rpm -qa --qf "%{n}\n" | sort | unqi | $0
@ssato
ssato / systemd-svc-mon.sh
Last active May 29, 2018 10:25
A sample script to monitor systemd service units forever.
#! /bin/bash
#
# A sample script to monitor systemd service units forever.
#
# Requirements: timeout and sleep in coreutils, uuidgen in utl-linux and systemd
#
# Author: Satoru SATOH <[email protected]>
# License: MIT
#
set -e
@ssato
ssato / collect_tower-cli_help_texts.sh.txt
Created August 27, 2018 18:58
The log of 'collect_tower-cli_help_texts.sh' run
ssato@localhost% time bash -x ./autoinstall.d/data/awx/3/collect_tower-cli_help_texts.sh | tee /tmp/collect_tower-cli_help_texts.sh.txt
# tower-cli --help
Usage: tower-cli [OPTIONS] COMMAND [ARGS]...
Options:
--version Display tower-cli version.
--help Show this message and exit.
Commands:
config Read or write tower-cli configuration.
@ssato
ssato / anyconfig_cli example to modify the content of YAML file
Last active January 31, 2019 06:16
anyconfig_cli example to modify the content of YAML file
ssato@x1-carbon-gen6% anyconfig_cli -h | grep -A 20 -E \^Query
Query/Get/set options:
-Q QUERY, --query QUERY
Query with JMESPath expression language. See
http://jmespath.org for more about JMESPath
expression. This option is not used with --get option
at the same time. Please note that python module to
support JMESPath expression
(https://pypi.python.org/pypi/jmespath/) is required
to use this option
@ssato
ssato / diff_output_python-molecule_spec_files
Last active May 13, 2019 15:28
An experimental pathc to unpin, relax version dependencies of molecule
ssato@x1-carbon-gen6% diff -u python-molecule.spec{.unpin,}
--- python-molecule.spec.unpin 2019-05-11 23:12:14.261507627 +0900
+++ python-molecule.spec 2019-05-11 23:12:37.541671159 +0900
@@ -15,6 +15,7 @@
URL: https://github.com/metacloud/molecule
Source0: https://github.com/metacloud/molecule/archive/%{version}.tar.gz
+Patch0: molecule-2.20.1_unpin.patch
BuildArch: noarch
# .. seealso:: https://fedoramagazine.org/two-factor-authentication-ssh-fedora/
ssato@x1-carbon-gen6% sudo dnf install -y google-authenticator
[sudo] password for ssato:
...
Dependencies resolved.
...
Installed:
google-authenticator-1.04-4.fc30.x86_64
Complete!
@ssato
ssato / gist:41b9aa67de737c493e4eeda76c9c686c
Last active December 10, 2019 15:05
listing_txt_files_under_given_dir
ssato@x1-carbon-gen6% tree /tmp/4
/tmp/4
├── a
│   └── 0.txt
├── b
│   └── 1.txt
└── c
└── d
└── 3.txt