Skip to content

Instantly share code, notes, and snippets.

View mig5's full-sized avatar

mig5

View GitHub Profile
# This file is automatically @generated by Poetry 1.4.2 and should not be changed by hand.
[[package]]
name = "ansible"
version = "7.6.0"
description = "Radically simple IT automation"
category = "main"
optional = false
python-versions = ">=3.9"
files = [
@mig5
mig5 / gist:3b352d2d09d61faddfb2b722e60478ee
Created December 8, 2022 23:39
mastodon hardened docker-compose.yml
version: '3'
services:
db:
restart: always
image: postgres:14-alpine
shm_size: 256mb
networks:
- internal_network
user: "70"
cap_drop:
@mig5
mig5 / ipfs-folder-and-files-publish-poc.py
Last active November 25, 2022 12:03
A PoC showing how to publish a folder containing files to IPFS via Python using requests module
#!/usr/bin/env python3
# This code is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. The author
# accepts no responsibility for its use, of which you do so at
# your own risk.
import json
import requests
#!/usr/bin/env python3
import nacl.public
import base64
from stem.control import Controller
def base_32(key):
# bytes to base 32
#!/usr/bin/env python3
import base64
import threading
from http.server import BaseHTTPRequestHandler, HTTPServer
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey
from cryptography.hazmat.primitives import serialization
from stem.control import Controller
### autoscale.tf
data "template_file" "userdata" {
template = "${file("templates/userdata.tpl")}"
vars {
region = "${var.region}"
file_system_id = "${aws_efs_file_system.prod-efs.id}"
}
}
resource "aws_launch_configuration" "mig5-prod-lc" {
diff --git a/onionshare/onion.py b/onionshare/onion.py
index 7122c20..6066f05 100644
--- a/onionshare/onion.py
+++ b/onionshare/onion.py
@@ -494,7 +494,7 @@ class Onion(object):
# A new private key was generated and is in the Control port response.
if self.settings.get('save_private_key'):
if not self.settings.get('private_key'):
- self.settings.set('private_key', key_content)
+ self.settings.set('private_key', res.private_key)
diff --git a/onionshare/__init__.py b/onionshare/__init__.py
index 2f0ef14..069559c 100644
--- a/onionshare/__init__.py
+++ b/onionshare/__init__.py
@@ -33,8 +33,12 @@ def main(cwd=None):
"""
common = Common()
- # Load settings right away, in order to get locale setting for strings
- common.load_settings(config)
@mig5
mig5 / qubes-template-update.sh
Last active July 18, 2018 12:04
qubes-template-update
#!/bin/bash
#
# Script to update template images in a big batch
#
# Get a list of templates
TEMPLATES=$(qvm-ls | grep Tpl | awk {'print $1'} |cut -d[ -f2 | cut -d] -f1)
usage()
{
Building in workspace /home/jenkins/jobs/onionshare_nightly_gui_test/workspace
Wiping out workspace first.
Cloning the remote Git repository
Cloning repository https://github.com/micahflee/onionshare
> git init /home/jenkins/jobs/onionshare_nightly_gui_test/workspace # timeout=10
Fetching upstream changes from https://github.com/micahflee/onionshare
> git --version # timeout=10
> git fetch --tags --progress https://github.com/micahflee/onionshare +refs/heads/*:refs/remotes/origin/*
> git config remote.origin.url https://github.com/micahflee/onionshare # timeout=10
> git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10