Skip to content

Instantly share code, notes, and snippets.

@b10n1k
b10n1k / get_bash_colors.sh
Created December 11, 2019 09:22
Display the meaning of colorful bash output
eval $(echo "no:global default;fi:normal file;di:directory;ln:symbolic link;pi:named pipe;so:socket;do:door;bd:block device;cd:character device;or:orphan symlink;mi:missing file;su:set uid;sg:set gid;tw:sticky other writable;ow:other writable;st:sticky;ex:executable;"|sed -e 's/:/="/g; s/\;/"\n/g')
{
IFS=:
for i in $LS_COLORS
do
echo -e "\e[${i#*=}m$( x=${i%=*}; [ "${!x}" ] && echo "${!x}" || echo "$x" )\e[m"
done
}
"""
* name file something like zypper_up.py
* copy into ~/.config/py3status/modules/
* edit i3status conf file
*Ctl+Shift+r
"""
import subprocess
import re
@b10n1k
b10n1k / get-image-config.sh
Created November 3, 2021 18:28 — forked from cirocosta/get-image-config.sh
Retrieves the configuration of images pushed to Docker registries - see https://ops.tips/blog/inspecting-docker-image-without-pull/ for more information
#!/bin/bash
# Retrieves image configuration using
# private registries without authentication
set -o errexit
# Address of the registry that we'll be
# performing the inspections against.
# This is necessary as the arguments we
@b10n1k
b10n1k / twup.sh
Last active December 5, 2021 05:45
#!/bin/bash
export ZYPP_MEDIANETWORK=1
export ZYPP_SINGLE_RPMTRANS=1
zypper ref && zypper dup
@b10n1k
b10n1k / gnupg_scdaemon.md
Created December 7, 2021 08:33 — forked from artizirk/gnupg_scdaemon.md
OpenPGP SSH access with Yubikey and GnuPG

OpenPGP SSH access with Yubikey and GnuPG

Yubikey, Smart Cards, OpenSC and GnuPG are pain in the ass to get working. Those snippets here sould help alleviate pain.

Yubikey Config under Ubuntu

To reset and disable not used modes on Yubikey you need the ykman program

You can install it using those commands

from ocw.lib.gce import GCE
from webui.settings import PCWConfig
from tests.generators import min_image_age_hours, max_image_age_hours, gce_max_service_account_age_hours, gce_min_service_account_age_hours
from tests.generators import mock_get_feature_property
from tests import generators
from datetime import datetime, timezone, timedelta
import googleapiclient.discovery
from googleapiclient.http import HttpMock
from googleapiclient.http import HttpMockSequence
import json
from .vault import GCECredential
from .provider import Provider, Image
import googleapiclient.discovery
from google.oauth2 import service_account
from dateutil.parser import parse
from .decorators import filterService
from googleapiclient.errors import HttpError
import re
{'keys': [{'name': 'projects/suse-sle-qa/serviceAccounts/[email protected]/keys/c718317203fdacf1833db761b45c0a8beb6f7bbd', 'validAfterTime': '2021-12-12T11:25:04.835862+00:00'}, {'name': 'projects/suse-sle-qa/serviceAccounts/[email protected]/keys/c718317203fdacf1833db761b45c0a8beb6f7bbd', 'validAfterTime': '2021-12-12T11:25:04.835862+00:00'}, {'name': 'projects/suse-sle-qa/serviceAccounts/[email protected]/keys/c718317203fdacf1833db761b45c0a8beb6f7bbd', 'validAfterTime': '2021-12-13T08:25:04.835889+00:00'}, {'name': 'projects/suse-sle-qa/serviceAccounts/[email protected]/keys/c718317203fdacf1833db761b45c0a8beb6f7bbd', 'validAfterTime': '2021-12-12T11:25:04.835862+00:00'}, {'name': 'projects/suse-sle-qa/serviceAccounts/[email protected]/keys/c718317203fdacf1833db761b45c0a8beb6f7bbd', 'validAfterTime': '2021-12-12
{'accounts': [{'name': 'projects/suse-sle-qa/serviceAccounts/[email protected]', 'email': '[email protected]'}, {'name': 'projects/suse-sle-qa/serviceAccounts/[email protected]', 'email': '[email protected]'}, {'name': 'projects/suse-sle-qa/serviceAccounts/[email protected]', 'email': '[email protected]'}]}
from ocw.lib.gce import GCE
from webui.settings import PCWConfig
from tests.generators import min_image_age_hours, max_image_age_hours, gce_max_service_account_age_hours, gce_min_service_account_age_hours
from tests.generators import mock_get_feature_property
from tests import generators
from datetime import datetime, timezone, timedelta
import googleapiclient.discovery
from googleapiclient.http import HttpMock
from googleapiclient.http import HttpMockSequence
from googleapiclient.discovery import build