Skip to content

Instantly share code, notes, and snippets.

View aschwinwester's full-sized avatar

aschwinwester

View GitHub Profile

Local setup mac First create personal access token with the following scopes: read_api, read_registry Than create this file inside ~/.pip/pip.conf:

[global]
index-url=https://__token__:<PERSONAL_ACCESS_TOKEN>@mycompany.gitlab.host/api/v4/projects/1252/packages/pypi/simple
extra-index-url=https://pypi.org/simple

Local setup windows

@aschwinwester
aschwinwester / settings.json
Created February 9, 2024 08:17
vscode info
# Depending on your platform, the user settings file is located here:
# Windows %APPDATA%\Code\User\settings.json
# macOS $HOME/Library/Application Support/Code/User/settings.json
# Linux $HOME/.config/Code/User/settings.json
{
"files.autoSave": "afterDelay",
"yaml.customTags": [
"!And",
"!And sequence",
@aschwinwester
aschwinwester / gist:a7e624c639fa15d853299af2be5bd2fb
Created February 21, 2023 07:41
double quotes issue windows
CTRL SHIFT
Keyboard without International.
@aschwinwester
aschwinwester / .vimrc
Last active February 9, 2024 07:43
personal vimrc
"""""""""
" Personal settings
" Don't put any lines in your vimrc that you don't understand.
"""""""""
"
"
""""""""
" resources
" https://github.com/amix/vimrc/tree/master/vimrcs
" https://dougblack.io/words/a-good-vimrc.html
@aschwinwester
aschwinwester / certificates-python.md
Created September 23, 2022 06:14
Add custom TLS certificates to Python

Add custom certificates for Python 3

The Python module requests might need custom certificates. You can add them globally of add them to the certifi module.

Option 1 add to system CA

Use the system CA

Certificate bundle location

python3 -m requests.certs
@aschwinwester
aschwinwester / openssl.md
Last active May 6, 2022 08:54
openssl x509 and pkcs12 tips

CLI tips for openssl

Some commands I used often

X509

Create CSR with new key

This will not encrypt the private key. It uses the configuration file

openssl req -utf8 -nodes -sha256 \ 
@aschwinwester
aschwinwester / print_http_request.py
Created November 17, 2020 18:39
python 3 print raw http request using requests
import textwrap
import requests
def print_roundtrip(response, *args, **kwargs):
format_headers = lambda d: '\n'.join(f'{k}: {v}' for k, v in d.items())
print(textwrap.dedent('''
---------------- request ----------------
{req.method} {req.url}
{reqhdrs}
@aschwinwester
aschwinwester / bash-flags.md
Created October 28, 2020 19:51
bash flags
while test $# -gt 0; do
  case "$1" in
    -h|--help)
      echo "$package - attempt to capture frames"
      echo " "
      echo "$package [options] application [arguments]"
      echo " "
      echo "options:"
 echo "-h, --help show brief help"
@aschwinwester
aschwinwester / git-bump-version.md
Last active September 11, 2020 08:16
git bump version.md
!#/bin/bash
export version='0.1'
export tag_prefix='my_project'

git fetch --tags
latest_build=`git tag -l ${tag_prefix}-v${version}.* --sort -version:refname | head -n1 | sed s/${tag_prefix}-v${version}\\.//`
export new_version=${version}.`echo \$((\${latest_build:--1}+1))`
git tag ${tag_prefix}-v${new_version}
git push origin --tags
@aschwinwester
aschwinwester / curl-certificates.md
Created May 8, 2020 11:02
curl with certificates
curl -v https://example.com/keepalive –-key client.key –-cacert ca.crt –-cert client.crt