Skip to content

Instantly share code, notes, and snippets.

View pauricthelodger's full-sized avatar

Padraic Harley pauricthelodger

View GitHub Profile
@smparekh
smparekh / config.fish
Last active May 10, 2022 16:52
Using CodeArtifact as Pypi mirror for Pipenv
set -x AWS_PROFILE default # replace
set -x AWS_REGION us-east-1 # replace
set -x CODEARTIFACT_DOMAIN foo # replace
set -x CODEARTIFACT_DOMAIN_ID 123456789 # replace
set -x CODEARTIFACT_REPOSITORY somepypi # replace
function codeartifact_login
set -Ux CODEARTIFACT_TOKEN (aws --profile $AWS_PROFILE codeartifact get-authorization-token --domain $CODEARTIFACT_DOMAIN --domain-owner $CODEARTIFACT_DOMAIN_ID --query authorizationToken --output text)
set -Ux PIPENV_PYPI_MIRROR "https://aws:$CODEARTIFACT_TOKEN@$CODEARTIFACT_DOMAIN-$CODEARTIFACT_DOMAIN_ID.d.codeartifact.$AWS_REGION.amazonaws.com/pypi/$CODEARTIFACT_REPOSITORY/simple/"
end
@frank-dspeed
frank-dspeed / 2018-https-localhost.md
Last active December 19, 2023 07:20 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

Create a own domain (1-10 Domains No Wildcards)

edit /etc/hosts add my.

@Samffy
Samffy / xps13.md
Last active December 28, 2022 22:37
Dell XPS 13 9360 : Ubuntu Wifi disconnection

I encounter wifi disonnection problem on a Dell XPS 13 9360. Here is the solution I used to fix this bad behavior.

Which wifi card version is installed ?

lspci | grep -i net

3a:00.0 Network controller: Qualcomm Atheros QCA6174 802.11ac Wireless Network Adapter (rev 32)

@codemedic
codemedic / vpn-docker-fix
Last active June 25, 2024 14:24
Docker network through host IPSec / Strongswan VPN
#!/usr/bin/env bash
# Link up docker network via IPSec VPN on docker-host.
#
# NOTE: This script can either be "sourced" into your .bashrc or executed directly. Be
# it sourced or executed, the usage syntax below is the same.
#
# Usage: [dry_run=1] [debug=1] vpn-docker-fix [docker-network-1 [docker-network-2 ...]]
#
# Env Variables:
@jnoller
jnoller / Comms.md
Last active March 18, 2016 19:49
Adapted Gitlab communications section

Internal Communication DRAFT

  • Use asynchronous communication when possible (issues and email instead of chat), issues are preferred over email, email is preferred over chat, announcements happen via email or team standup, and people should be able to do their work without getting interrupted by chat.
    • More importantly, a verbal or chat record does not spread communication widely and can vary based the person delivering the message (bias) or other tribal interpretation. A written record is always critical when it comes to questions, strategy and decisions. When decisions or information is ad-hoc is reinforces the idea that people are treated unequally, do not have a voice and are kept in the dark.
  • It is very OK to ask as many questions as you have, but ask them so many people can answer them and many people see the answer (so use issues or public chat channels instead of private messages or one-on-one emails) and make sure you try to document the answers.
  • If applicable, use github to track
@mgoodness
mgoodness / format-etcd-ebs.service
Last active January 2, 2021 22:08
Systemd unit file to format EBS volume
[Unit]
Description=Format EBS volume if needed
Before=etcd2.service
[Service]
ExecStart=/bin/bash -c \
'(/usr/sbin/blkid -t TYPE=ext4 | grep /dev/xvdb) || \
(/usr/sbin/wipefs -fa /dev/xvdb && /usr/sbin/mkfs.ext4 /dev/xvdb)'
RemainAfterExit=yes
Type=oneshot
@mgoodness
mgoodness / var-lib-etcd2.mount
Last active July 20, 2020 12:29
Systemd unit file to mount EBS volume to /var/etc/data
[Unit]
Description=Mount EBS volume at /var/lib/etcd2
Requires=format-etcd-ebs.service
After=format-etcd-ebs.service
Before=etcd2.service
[Mount]
DirectoryMode=0777
Type=ext4
What=/dev/xvdb
@seanjensengrey
seanjensengrey / rust-python-cffi.md
Last active April 3, 2024 11:55
Calling Rust from Python/PyPy using CFFI (C Foreign Function Interface)

This is a small demo of how to create a library in Rust and call it from Python (both CPython and PyPy) using the CFFI instead of ctypes.

Based on http://harkablog.com/calling-rust-from-c-and-python.html (dead) which used ctypes

CFFI is nice because:

  • Reads C declarations (parses headers)
  • Works in both CPython and PyPy (included with PyPy)
  • Lower call overhead than ctypes
@rochacbruno
rochacbruno / mainpython.md
Last active July 5, 2023 10:56
Use of __main__.py

The use of __main__.py to create executables

myprojectfolder/
    |_ __main__.py
    |_ __init__.py

Being __main__.py:

print("Hello")