Skip to content

Instantly share code, notes, and snippets.

View jreisinger's full-sized avatar
๐Ÿ‘‹
hello friend

Jozef Reisinger jreisinger

๐Ÿ‘‹
hello friend
View GitHub Profile

pyenv - mutliple pythons

curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer | bash

# maybe put this in your ~/.bashrc...
export PATH="/home/reisinge/.pyenv/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
#!/usr/bin/env python3
import subprocess
import collections
import pprint
data = collections.defaultdict(list)
# Ge list of files and directories
lines = subprocess.check_output(['ls', '-la']).decode('utf-8').split('\n')
#!/usr/bin/env python3
""" Print line number and line from /etc/passwd with the given UID.
"""
##########
UID = 1000
##########
import fileinput, sys

๐Ÿ˜ญ ๐Ÿ‘Ž โœŒ๏ธ ๐Ÿ–• ๐Ÿ‘‚ ๐Ÿฑ ๐Ÿฎ ๐Ÿ› ๐Ÿ ๐ŸŽจ

@jreisinger
jreisinger / emojis.md
Last active May 30, 2023 16:38
emojis

People

:bowtie: :bowtie: ๐Ÿ˜„ :smile: ๐Ÿ˜† :laughing:
๐Ÿ˜Š :blush: ๐Ÿ˜ƒ :smiley: โ˜บ๏ธ :relaxed:
๐Ÿ˜ :smirk: ๐Ÿ˜ :heart_eyes: ๐Ÿ˜˜ :kissing_heart:
๐Ÿ˜š :kissing_closed_eyes: ๐Ÿ˜ณ :flushed: ๐Ÿ˜Œ :relieved:
๐Ÿ˜† :satisfied: ๐Ÿ˜ :grin: ๐Ÿ˜‰ :wink:
๐Ÿ˜œ :stuck_out_tongue_winking_eye: ๐Ÿ˜ :stuck_out_tongue_closed_eyes: ๐Ÿ˜€ :grinning:
๐Ÿ˜— :kissing: ๐Ÿ˜™ :kissing_smiling_eyes: ๐Ÿ˜› :stuck_out_tongue:
#!/usr/bin/python3
import os, shutil, sys
topdir = ""
if len(sys.argv) > 1:
topdir = sys.argv[1]
else:
print("Usage:", sys.argv[0], "DIR")
#!/usr/bin/env python3
import re
def max_length(strings):
max_len = 0
for s in strings:
if len(s) > max_len:
max_len = len(s)
return max_len

Limiting a Docker container's memory resource


Terminology

  • Docker server - the docker command run in daemon mode on a Linux host

  • Docker image - packaged application with all needed files (libs, configs)

      $ docker pull ...
      $ docker build ...