Skip to content

Instantly share code, notes, and snippets.

@damascene
damascene / gist_markdown_examples.md
Last active April 29, 2024 18:35 — forked from ww9/gist_markdown_examples.md
Gist markdown examples

Gist markdown examples

A collection of Markdown code and tricks that were tested to work in Gist. testa sdfds fds

This and all public gists in https://gist.github.com/ww9 are Public Domain. Do whatever you want with it including , no need to credit me.

Todo

  • Reformat this whole document and assimilate these:
@damascene
damascene / com.github.example.toml
Created April 29, 2024 13:27
Example user profile template for use with the Hur project
file_format = "0.1.1"
file_language = "en"
tags = [ "Design", "C", "image", "Programming", "logo" ]
[data]
name = "John Smith"
profile_image = "https://picsum.photos/id/175/100/100"
user_description = """
@damascene
damascene / blockchain_app.py
Created September 14, 2022 06:19
Bitcoin Cash Node RPC to JSON API using Python and Cherrpy Simple
import cherrypy # Imported the web framework
import requests # Library to communicate with RPC
import json # Library to parse and form Json
# Variables to access RPC
url = 'http://localhost:29332/'
rpc_user='localuser'
rpc_password='your_rpc_password'
# Function to call RPC with a provided method
@damascene
damascene / subprocessdemote.py
Last active September 5, 2021 17:42 — forked from sweenzor/subprocessdemote.py
Run python subprocess(es) as another user Python3
#!/usr/bin/env python
import os
import subprocess
# > python subprocessdemote.py
# > sudo python subprocessdemote.py
def check_username():
@damascene
damascene / fix_daemon_and_misc.patch
Created July 9, 2021 03:50
fix token validity issue in daemon mode in EC SLP wallet
diff --git a/electroncash/slp_graph_search.py b/electroncash/slp_graph_search.py
index ec61800e3..25b143aef 100644
--- a/electroncash/slp_graph_search.py
+++ b/electroncash/slp_graph_search.py
@@ -365,7 +365,7 @@ class _SlpGraphSearchManager:
if dat.get('message', None):
msg = dat['message']
if 'txid is missing from slp validity set' in msg:
- raise Exception('likely invalid slp')
+ raise Exception("maybe invalid slp (gs returned: 'txid is missing from slp validity set')")
#!/bin/bash
#A script to reboot routers that accept telnet connections, it connects then report ip before and after restart.
#alternative get public ip servers
#dig TXT +short o-o.myaddr.l.google.com @ns1.google.com
#dig +short myip.opendns.com @resolver2.opendns.com
user_name="username"
password="password"
@damascene
damascene / PowerFailureAlarm.py
Last active August 5, 2019 14:57
Power failure alarm based on laptop battery notifications
#!/usr/bin/env python3
# Built on https://askubuntu.com/a/519045
#License: GPL v 3.0
#Copyrigt: Damascene
import subprocess
import time
def read_status():
"""

channel operator quick reference

direct discussion about administrative action away from the main channel and into #reddit-diabetes-ops to minimise disruption. our -ops channel is the place where users should come to ask for our help. examples:

  • any sort of operator request or discussion of channel administration in the main channel
  • PMs asking why a ban was set
  • reports of harassment (unless the user is confiding in you)
  • any request for operator action

changing channel access permissions