Skip to content

Instantly share code, notes, and snippets.

View ostree's full-sized avatar
:electron:
Rocket science at home!

(richardredditch) r3gards ostree

:electron:
Rocket science at home!
View GitHub Profile
[DEFAULT]
main-repo = gentoo
[gentoo]
location = /var/db/repos/gentoo
sync-type = git
# Official "sync-friendly git mirror of repo/gentoo with caches and metadata"
# sync-uri = https://anongit.gentoo.org/git/repo/sync/gentoo.git
# GitHub mirror (saves the Gentoo project bandwidth - of *this* sync-friendly git mirror is preferred)
sync-uri = https://github.com/gentoo-mirror/gentoo.git
@ostree
ostree / mapproxy.yaml
Created December 18, 2024 00:16 — forked from seanlinmt/mapproxy.yaml
sample mapproxy configuration
globals:
http:
client_timeout: 10
image:
resampling_method: bicubic
services:
demo:
tms:
use_grid_names: true
origin: 'nw'
@ostree
ostree / hackintosh.sh
Created December 18, 2024 00:15 — forked from seanlinmt/hackintosh.sh
mac OS QEMU with VGA passthrough, Clover EFI boot
QEMU_AUDIO_DRV=alsa QEMU_ALSA_ADC_BUFFER_SIZE=1024 QEMU_ALSA_ADC_PERIOD_SIZE=256 QEMU_ALSA_DAC_BUFFER_SIZE=1024 QEMU_ALSA_DAC_PERIOD_SIZE=256 QEMU_AUDIO_DAC_FIXED_SETTINGS=1 QEMU_AUDIO_DAC_FIXED_FREQ=44100 QEMU_A
UDIO_DAC_FIXED_FMT=S16 QEMU_AUDIO_ADC_FIXED_FREQ=44100 QEMU_AUDIO_ADC_FIXED_FMT=S16 QEMU_AUDIO_DAC_TRY_POLL=1 QEMU_AUDIO_ADC_TRY_POLL=1 QEMU_AUDIO_TIMER_PERIOD=50
/usr/local/bin/qemu-2.9.0 -machine q35,accel=kvm \
-cpu Penryn,kvm=on,vendor=GenuineIntel,+invtsc,+vmx,vmware-cpuid-freq=on \
-mem-prealloc \
-drive file=/hackintosh/OVMF_CODE.fd,if=pflash,format=raw,unit=0,readonly=on \
-drive file=/hackintosh/OVMF_VARS.fd,if=pflash,format=raw,unit=1 \
-m 4096 \
-smp 4,sockets=1,cores=2,threads=2 \
-device ioh3420,bus=pcie.0,addr=1c.0,multifunction=on,port=1,chassis=1,id=root.1 \
#!/usr/bin/env python
import json
import requests
import logging
import logging.handlers
import string
import sys
import ipaddress
logger = logging.getLogger(__name__)
@ostree
ostree / 85-u2f-screen-lock.rules
Created December 18, 2024 00:11 — forked from seanlinmt/85-u2f-screen-lock.rules
lock linux desktop via removal of U2F USB key or any USB device
# /etc/udev/rules.d/85-u2f-screen-lock.rules
# 2 REMOVE event rules for 2 different U2F devices
# to view the various properties you could use to create your rule use => udevadm monitor --property
# You may get multiple matches if your rule is too wide. No rule to unlock because it's not called 2FA for nothing.
# If you want to do that then you would need to add the matching rule for ADD events
ACTION=="remove", ENV{DEVTYPE}=="usb_device", ENV{SUBSYSTEM}=="usb", ENV{PRODUCT}=="1050/120/*", RUN+="/home/sean/bin/u2f-screen-lock.sh"
ACTION=="remove", ENV{ID_BUS}=="usb", ENV{ID_VENDOR_ID}=="096e", ENV{ID_MODEL_ID}=="0853", RUN+="/home/sean/bin/u2f-screen-lock.sh"
@ostree
ostree / debug.md
Created October 27, 2024 07:36 — forked from artizirk/debug.md
Debug WireGuard Linux kernel module
@ostree
ostree / 00README.md
Created May 8, 2021 20:42 — forked from natefoo/00README.md
Linux Distribution Detection

Distribution Detection

I am working on adding support for building and distributing (via PyPI) Python Wheels with C Extensions to the Python wheel and pip packages. The discussion on Distutils-SIG continues, but I believe it is fairly certain that some effort to correctly identify Linux distributions will need to be made. I've begun efforts to add this support to wheel.

How you can help

If you have a Linux distribution or version of a listed distribution not in this gist, or one of the ones I have not directly verified, I could use the following:

  • The contents of /etc/os-release, if it exists
@ostree
ostree / mongodb_shell_commands.md
Created April 25, 2021 14:16 — forked from ebnhxcode/mongodb_shell_commands.md
Quick Cheat Sheet for Mongo DB Shell commands.

MongoDB Shell Commands Cheat Sheet.

This is a Cheat Sheet for interacting with the Mongo Shell ( mongo on your command line). This is for MongoDB Community Edition.

Preface:

Mongo Manual can help you with getting started using the Shell.

FAQ for MongoDB Fundamentals and other FAQs can be found in the side-bar after visiting that link.

<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@ostree
ostree / centos7_ps_install.sh
Created April 25, 2021 14:16 — forked from ebnhxcode/centos7_ps_install.sh
CentOS 7: PrestaShop 1.7.2.0 installer
#!/bin/bash
PS_VERSON=1.7.2.0
prompt_confirm() {
while true; do
read -r -n 1 -p "${1:-Continue?} [y/n]: " REPLY
case $REPLY in
[yY]) echo ; return 0 ;;
[nN]) echo ; return 1 ;;