Skip to content

Instantly share code, notes, and snippets.

Avatar

Will Rouesnel wrouesnel

View GitHub Profile
@wrouesnel
wrouesnel / .editorconfig
Last active February 15, 2023 02:30
Python project autogen.sh
View .editorconfig
# Project editorconfig file.
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
insert_final_newline = true
max_line_length = 120
View ansible.cfg
[defaults]
nocows = 1
remote_tmp=/tmp
inventory = inventory
timeout=20
# vault-keyring.py uses the Python 'keyring' module to retrieve and store the
# vault password. This should be reasonably cross-platform and you definitely
# should have a working python environment if you're using this repo.
#vault_password_file = vault-keyring.py
@wrouesnel
wrouesnel / .bashrc
Created February 2, 2023 04:13
Generic bashrc with some sensible defaults
View .bashrc
#!/bin/bash
# Common Linux bashrc
function prompt_add() {
if [ ! -z "$PROMPT_COMMAND" ]; then
export PROMPT_COMMAND="$PROMPT_COMMAND;$*"
else
export PROMPT_COMMAND="$*"
fi
}
@wrouesnel
wrouesnel / dependency-free-requests.py
Created October 17, 2022 23:13
Make request without requests
View dependency-free-requests.py
# https://dev.to/bowmanjd/http-calls-in-python-without-requests-or-other-external-dependencies-5aj1
import json
import typing
import urllib.error
import urllib.parse
import urllib.request
from email.message import Message
View gist:29ac3a24e5757e92fade3988a0ff43f9
FROM rocm/rocm-terminal
USER root
WORKDIR /root
# Install font for prompt matrix
COPY data/DejaVuSans.ttf /usr/share/fonts/truetype/
RUN apt update && apt install -y python3.8-venv wget
@wrouesnel
wrouesnel / relative_requests_session
Created August 24, 2022 10:30
Python relative requests session
View relative_requests_session
import requests
from furl import furl
class RelativeSession(requests.Session):
def __init__(self, base_url):
super(RelativeSession, self).__init__()
self.__base_url = furl(base_url)
def request(self, method, url, **kwargs):
url = str(self.__base_url / url)
@wrouesnel
wrouesnel / collapsible.yml
Created August 23, 2022 03:00
gitlab collapsible sections
View collapsible.yml
# Start
- printf "\e[0Ksection_start:`date +%s`:execution_section_0[collapsed=true]\r\e[0KEnvironment Info\n"
# End
- printf "section_end:`date +%s`:execution_section_0\r\e[0K"
@wrouesnel
wrouesnel / reverseit.systemd
Created August 10, 2022 23:45
Systemd script with restarts which will keep going
View reverseit.systemd
[Unit]
Description=Maintain a reverseit SSH connection
After=network.target
StartLimitBurst=5
# This line disables the "stop forever" start back off
StartLimitIntervalSec=0
[Service]
Type=simple
@wrouesnel
wrouesnel / README.md
Created August 2, 2022 00:47
Firefox enterprise CA certs
View README.md
@wrouesnel
wrouesnel / README.md
Created July 23, 2022 10:22
Github Clone All
View README.md

Script for bulk cloning of Github repositories.