Skip to content

Instantly share code, notes, and snippets.

View jathanism's full-sized avatar
🍕
See below.

Jathan McCollum jathanism

🍕
See below.
View GitHub Profile

How to install Homebrew package manager on Steam Deck

(See also installing Distrobox: https://distrobox.it/ )
(See also installing Nix package manager: https://determinate.systems/posts/nix-on-the-steam-deck )

You can install Homebrew (a package manager for macOS and Linux) without disabling the read-only partition with sudo steamos-readonly disable.
The package manager can be used alongside Flatpaks. Some software is only available on Flathub, and some software is only available on Homebrew.

  1. Switch to desktop mode (hold power button until a menu appears, then select "Switch to desktop mode")
  2. Click the logo at the bottom left, go to System, then go to Konsole
@dustindorroh
dustindorroh / python_rsa_example.py
Last active December 12, 2023 02:21
RSA Encryption/Decryption with python
# Inspired from https://medium.com/@ismailakkila/black-hat-python-encrypt-and-decrypt-with-rsa-cryptography-bd6df84d65bc
# Updated to use python3 bytes and pathlib
import zlib
import base64
from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP
from pathlib import Path
@douglasmiranda
douglasmiranda / instructions.md
Created July 19, 2018 05:51
Add email to Keybase.io PGP Key (Public Key)

Export your public key:

keybase pgp export > keybase-public.key

Export your private key:

keybase pgp export --secret > keybase-private.key
@djego
djego / rsa.py
Created September 30, 2017 23:20
A simple RSA implementation in Python
'''
620031587
Net-Centric Computing Assignment
Part A - RSA Encryption
'''
import random
'''
import sys
from datetime import datetime
import time
from pprint import pprint
from trigger.cmds import Commando
from twisted.python import log
from twisted.internet import reactor
from trigger.netdevices import NetDevices, NetDevice
@coxley
coxley / asn_convert.py
Last active February 24, 2016 20:19
ASPLAIN to ASDOT (AS-PLAIN AS-DOT) and reverse
def plain_to_dot(asn): # -> str
'''Take ASPLAIN and return ASDOT notation
asn: int
'''
barray = struct.pack('>I', asn)
return '%d.%d' % struct.unpack('>HH', barray)
def dot_to_plain(asn): # -> int
# -*- coding: utf-8 -*-
"""
config_device2.py
Duplicate of `~trigger.contrib.commando.plugins.config_device` using
``Commando`` as a base vs. ``CommandoApplication``.
Bug fixes:
@jathanism
jathanism / 01_napalm_compat.py
Last active January 31, 2017 15:39
A very basic test of integration of Trigger's NetDevices/Tacacsrc w/ Napalm. There are two prototypes: 03_troll_test.py is testing using asyncio/trollius or async I/O. 04_twist_test.py is using Twisted.
"""
Integration of Trigger + NAPALM drivers
"""
from napalm import get_network_driver
def get_driver_for_netdevice(device):
vendor_name = device.vendor.name
if vendor_name == 'cisco':
# -*- coding: utf-8 -*-
"""
Loader for Trigger NetDevices using NSoT API.
Right now this loads ALL devices ALL the time, which scales very poorly with
the number of devices and attributes in NSoT.
Note that ``NETDEVICES_SOURCE`` is ignored because the settings from your
``~/.pynsotrc``.
@blueyed
blueyed / test_django_data_migration.py
Last active December 9, 2020 16:20
Test Django data migrations
"""
Test (data) migrations in Django.
This uses py.test/pytest-django (the `transactional_db` fixture comes from there),
but could be easily adopted for Django's testrunner:
from django.test.testcases import TransactionTestCase
class FooTestcase(TransactionTestCase):
def test_with_django(self):