Skip to content

Instantly share code, notes, and snippets.

View lcarva's full-sized avatar

Luiz Carvalho lcarva

  • Red Hat, Inc.
  • Eastern US
View GitHub Profile
@threeiem
threeiem / keychron-k2-function-keys-fedora33.md
Last active September 1, 2022 05:17
Keychron K2 Function and Multimedia Keys (Fedora)

Keychron K2 or C1 Funtion and Multimedia Keys (Fedora)

Keyboard Mode Switch

On the left hand side of the keyboard there are two switches. Slide the switch closest to the USB port to "Win/Android". The writing can be very difficult to read because of the small letters. The "Win/Android" position on the switch is closest to the USB port.

Keyboard Mode for Function and Multimedia Keys

@tmckayus
tmckayus / insecure_registry_crc.md
Created October 8, 2019 18:02
Adding an insecure registry for crc

Adding insecure registries on crc (and other things that require a node reboot)

Overview

Since crc deploys the OpenShift instance in a single VM, certain configuration changes can't be applied using the normal OpenShift mechanism. In a full deployment with multiple nodes, OpenShift coordinates the update and reboot of each node in the cluster, evacuating and rescheduling pods as it goes so everything continues to run. With a single VM this isn't possible, so some configuration changes have to be made manually.

@tmckayus
tmckayus / remote_crc.md
Last active May 17, 2024 21:58
Running 'crc' on a remote server

Overview: running crc on a remote server

This document shows how to deploy an OpenShift instance on a server using CodeReady Containers (crc) that can be accessed remotely from one or more client machines (sometimes called a "headless" instance). This provides a low-cost test and development platform that can be shared by developers. Deploying this way also allows a user to create an instance that uses more cpu and memory resources than may be available on his or her laptop.

While there are benefits to this type of deployment, please note that the primary use case for crc is to deploy a local OpenShift instance on a workstation or laptop and access it directly from the same machine. The headless setup is configured completely outside of crc itself, and supporting a headless setup is beyond the mission of the crc development team. Please do not ask for changes to crc to support this type of deployment, it will only cost the team time as they politely decline :)

The instructions here were tested with F

@MartinBasti
MartinBasti / entrypoints.md
Created November 30, 2018 14:25
Dockerfile single/double quotes in ENTRYPOINT

Double quoted entry point value

$ cat Docketrfile
FROM fedora
ENTRYPOINT ["echo"]
$ docker run --rm echotest hello 
@zaiste
zaiste / rst_to_md.sh
Created February 5, 2017 18:54
Convert RST to Markdown using Pandoc
FILES=*.rst
for f in $FILES
do
filename="${f%.*}"
echo "Converting $f to $filename.md"
`pandoc $f -f rst -t markdown -o $filename.md`
done
@gwillem
gwillem / ansible-bootstrap-ubuntu-16.04.yml
Created June 16, 2016 21:59
Get Ansible to work on bare Ubuntu 16.04 without python 2.7
# Add this snippet to the top of your playbook.
# It will install python2 if missing (but checks first so no expensive repeated apt updates)
# gwillem@gmail.com
- hosts: all
gather_facts: False
tasks:
- name: install python 2
raw: test -e /usr/bin/python || (apt -y update && apt install -y python-minimal)
@limed
limed / sort-nicely.py
Created July 1, 2015 17:54
Sorts thing nicely in python
#!/usr/bin/python
def sort_nicely(l):
""" Sort the given list in the way that humans expect.
"""
convert = lambda text: int(text) if text.isdigit() else text
alphanum_key = lambda key: [ convert(c) for c in re.split('([0-9]+)', key) ]
l.sort( key=alphanum_key )
@TemporaryJam
TemporaryJam / Howto convert a PFX to a seperate .key & .crt file
Last active April 4, 2024 10:52
How to convert a .pfx SSL certificate to .crt/key (pem) formats. Useful for NGINX
source: http://www.markbrilman.nl/2011/08/howto-convert-a-pfx-to-a-seperate-key-crt-file/
`openssl pkcs12 -in [yourfile.pfx] -nocerts -out [keyfile-encrypted.key]`
What this command does is extract the private key from the .pfx file. Once entered you need to type in the importpassword of the .pfx file. This is the password that you used to protect your keypair when you created your .pfx file. If you cannot remember it anymore you can just throw your .pfx file away, cause you won’t be able to import it again, anywhere!. Once you entered the import password OpenSSL requests you to type in another password, twice!. This new password will protect your .key file.
Now let’s extract the certificate:
`openssl pkcs12 -in [yourfile.pfx] -clcerts -nokeys -out [certificate.crt]`
@wumpz
wumpz / gist:5846559
Created June 23, 2013 21:12
list authors of a git repository including commit count and email
git shortlog -e -s -n