Skip to content

Instantly share code, notes, and snippets.

@bmaupin
bmaupin / docker-container-exposure-to-network.md
Last active Feb 19, 2021
Docker container exposure to network
View docker-container-exposure-to-network.md
Method Docker iptables setting Firewall on? Exposed to local network
docker run --network=host -p 3306:3306 false No Yes
docker run --network=host -p 3306:3306 false Yes No
docker run -p 3306:3306 Default Yes ⚠️ Yes
docker run -p 127.0.0.1:3306:3306 Default Yes No

An alternative option would be to leave the Docker iptables as the default, leave the firewall on, and modify iptables itself à la https://stackoverflow.com/a/51741599/399105

@bmaupin
bmaupin / nsui-via-wine.md
Last active Mar 16, 2021
Use NSUI via Wine
View nsui-via-wine.md
@bmaupin
bmaupin / tl-wr841n-range-extender.md
Last active Oct 9, 2020
Make TP-Link TL-WR841N a wireless range extender
View tl-wr841n-range-extender.md

Using the stock firmware

  1. Connect to the primary router and set the 2.4 GHz network to a specific channel
    • The channels must be the same for WDS to work
  2. Connect to the router using a network cable
  3. If you're running OpenWrt, you'll need to flash the stock firmware
    1. Download the latest firmware for your hardware version from TP-Link's website
    2. Strip the stock firmware using dd; see the steps here: https://openwrt.org/toh/tp-link/tl-wr841nd#go_back_to_original_firmware
    3. Flash the stock firmware from LUCI
  4. Browse to the stock firmware web interface (192.168.0.1)
@bmaupin
bmaupin / never-alone-fix.sh
Created Oct 3, 2020
Never Alone texture fix
View never-alone-fix.sh
# See: https://github.com/dscharrer/void/blob/master/hacks/neveralonefix.c
sudo apt install gcc-multilib libgl1-mesa-dev libgl1-mesa-dev:i386 pkg-config
curl https://raw.githubusercontent.com/dscharrer/void/master/hacks/neveralonefix.c > ~/.local/share/Steam/steamapps/common/NeverAlone/neveralonefix.c
# Then set game launch options to: sh neveralonefix.c %command%
# (https://support.steampowered.com/kb_article.php?ref=1040-JWMT-2947)
View talos-principle-save-file.md
  • gzipped binary file
    • 12 byte gzip "extra field" set
      • Not sure how important this is or what it contains. It doesn't appear to be related to the version of the game.
      • Subfield ID 1 (SI1) is always: C (0x43)
      • Subfield ID 2 (SI2) is always: T (0x54)
      • Data:
        • Sample 1: 0x8C 2A 00 00 07 35 01 00
          • .bkp file: 0x78 2A 00 00 C7 34 01 00
        • Sample 2: 0x44 30 00 00 CD 56 01 00
          • .bkp file: 0x40 30 00 00 CD 56 01 00
@bmaupin
bmaupin / extundelete-no-such-file-or-directory-while-creating-directory.md
Created May 29, 2020
extundelete "no such file or directory while creating directory"
View extundelete-no-such-file-or-directory-while-creating-directory.md

This error may occur when using extundelete with -o:

extundelete: No such file or directory while creating directory

The problem is that -o expects a relative path to the current directory (not an absolute path). Either use -o with a relative path or remove -o.

Source: https://www.itread01.com/p/158985.html

@bmaupin
bmaupin / install-oracle-client-ubuntu.md
Last active Feb 11, 2021
Install Oracle client on Ubuntu 18.04
View install-oracle-client-ubuntu.md

Reference: https://help.ubuntu.com/community/Oracle%20Instant%20Client

  1. Decide which version of the Oracle client to install

  2. Download the Oracle client packages

@bmaupin
bmaupin / convert-deploymentconfig-to-deployment.md
Last active Mar 19, 2021
Convert OpenShift DeploymentConfig to Kubernetes Deployment
View convert-deploymentconfig-to-deployment.md
  1. Change apiVersion from:

    - apiVersion: v1

    (or apiVersion: apps.openshift.io/v1)

    to:

@bmaupin
bmaupin / using-buildah-inside-a-rhel-container.md
Last active Oct 1, 2019
Using buildah inside a RHEL container
View using-buildah-inside-a-rhel-container.md

Why

  • Unlike Docker, buildah doesn't need root privileges to run
  • Buildah can pass yum entitlements from build container to container being built
    • Since this has to be done manually (see /run/secrets:/run/secrets below) couldn't Docker do this as well?

Steps

  1. Make sure you're using a RHEL host registered with yum

  2. Make sure you're using RHEL build container image, such as:

@bmaupin
bmaupin / parse-openshift-logs-in-graylog.md
Last active Oct 1, 2019
Parse OpenShift logs in Graylog
View parse-openshift-logs-in-graylog.md

Problems

  • Application logs are mixed with kubernetes logs. They can be searched using a query similar to this one, but it's a bit unwieldy as it's not using Graylog fields (for example, the quotes can't be left out): "container_name=mycontainer"

  • The actual log message is prefixed with a bunch of extra information that makes the logs difficult to read in the Graylog UI. For example, the message in Graylog shows up as:

    app1.openshift.example.org output_tag: namespace_name=mynamespace, container_name=myapplication, pod_name=myapplication-7dd79c7bb7-qkfzk, message=Web server listening at: http://0.0.0.0:3000
    

    But the actual log message is: