Skip to content

Instantly share code, notes, and snippets.

View TheGardenMan's full-sized avatar
🚩
Escaping

TheGardenMan

🚩
Escaping
View GitHub Profile
@mikehearn
mikehearn / Scripts
Last active December 4, 2023 11:45
systemd unit monitoring setup
----------------------------------------------------
#!/usr/bin/env bash
# place in a file called email-unit-status.sh on the PATH
# requires you to have set /etc/admin-email to contain the address to receive the messages
# requires install of ansi2html
#
set -e
@jimbrig
jimbrig / dbml.py
Created May 20, 2022 21:26
[dbml.py] Python script to run with SchemaCrawler to Generate DBML Markup files from Database Schema #database #documentation #automation
from __future__ import print_function
import re
from schemacrawler.schema import TableRelationshipType # pylint: disable=import-error
from schemacrawler.schemacrawler import IdentifierQuotingStrategy # pylint: disable=import-error
from schemacrawler.utility import MetaDataUtility # pylint: disable=import-error
print('Project "' + catalog.crawlInfo.runId + '" {')
print(' database_type: "' + re.sub(r'\"', '', catalog.crawlInfo.databaseVersion.toString()) + '"')
print(" Note: '''")
print(catalog.crawlInfo)
@plembo
plembo / DisableMFAForAADUser.md
Last active April 16, 2024 12:17
Disable MFA for an individual Azure AD User

Disabling MFA for an Azure AD User

Azure AD MFA is not enabled by default for AAD and Microsoft 365 users, but it will be if during setup an admin chooses to Enable Security Defaults on Azure AD (as most will when prompted to do so: after all, who in their right mind wouldn't require MFA?).

However, there are situations where being able to toggle MFA on or off for a particular user can be useful. For example, in a development or test tenant when working with sample code from Microsoft that doesn't account for MFA (like a simple Microsoft Graph console app). This procedure involves disabling Security Defaults on AAD.

@noelli
noelli / 1 NGINX RTMP-Server Setup for local Streams.md
Last active October 3, 2023 15:34
Compile NGINX with RTMP and setup Multi-Streaming

Compile NGINX with RTMP and setup Multi-Streaming

These Scripts will install NGINX with the RTMP Module in the usual directories similar to installation with apt-get.

The RTMP-Server you get with this can then be used to do one ore more of the following:

  • deliver streams in a local network
  • deliver streams to websites similar to youtube
  • transcode rtmp streams to hls video
  • publish to multiple streaming providers
  • record livestreams to a harddrive
@ptantiku
ptantiku / setup-python3.8-via-ppa.sh
Last active April 14, 2023 12:31
Setup Python3.8 in Ubuntu Xenial (16.04 LTS). The python version was fixed at Python 3.5.1
#!/bin/sh
# install PPA
sudo add-apt-repository ppa:deadsnakes/ppa
# update and install
sudo apt update
sudo apt install python3.8 python3.8-dev python3.8-venv
# setup alternatives
@evadne
evadne / gist:440558b18228ca657ef22b465793a0c3
Last active June 21, 2024 01:57
Using SchemaCrawler on PostgreSQL databases
import React, { Component } from 'react'
export default class Login extends Component {
state = {
email: '',
password: ''
};
handleOnChange = event => {
@gasparrobi
gasparrobi / headlessChrome.md
Last active June 4, 2024 09:33
headless chrome from terminal in osX

1. set an alias for chrome:

alias chrome="/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome"

2. To remote control your chrome headless:

chrome --headless --disable-gpu --remote-debugging-port=9222

@vasanthk
vasanthk / System Design.md
Last active July 18, 2024 00:52
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@spalladino
spalladino / mysql-docker.sh
Created December 22, 2015 13:47
Backup and restore a mysql database from a running Docker mysql container
# Backup
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql
# Restore
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE