Skip to content

Instantly share code, notes, and snippets.

View MrTechGadget's full-sized avatar

Joshua Clark MrTechGadget

View GitHub Profile
@woodrow
woodrow / onc_converter.py
Created April 27, 2016 23:54
Convert OpenVPN config files to ChromeOS ONC files
import argparse
import json
import re
import sys
import uuid
class OpenVPNNetworkConfiguration(object):
KNOWN_CONFIG_KEYS = {
'name': {'key': 'Name'},
@mlynch
mlynch / cordova-plugin-guide.md
Last active February 3, 2023 00:21
Cordova Plugin Developer Guide

Cordova Plugin Development Guide (iOS and Android)

Version: 0.0.1 updated 7/1/2016

Cordova Plugins are the magic that enable our mobile web app content to access the full power of Native SDKs underneath, but through clean JavaScript APIs that work the same across all platforms we target.

Building Cordova plugins is scary for many Cordova and Ionic developers, but it doesn't have to be. This simple guide walks through the what, when, why, and how of Cordova plugin development for iOS and Android.

Introduction

@agentsim
agentsim / highsierra_bootable.sh
Created June 10, 2017 02:23
Create bootable ISO from HighSierra Installer
# Generate a BaseSystem.dmg with 10.13 Install Packages
hdiutil attach /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/InstallESD.dmg -noverify -mountpoint /Volumes/highsierra
hdiutil create -o /tmp/HighSierraBase.cdr -size 7316m -layout SPUD -fs HFS+J
hdiutil attach /tmp/HighSierraBase.cdr.dmg -noverify -mountpoint /Volumes/install_build
asr restore -source /Applications/Install\ macOS\ 10.13\ Beta.app/Contents/SharedSupport/BaseSystem.dmg -target /Volumes/install_build -noprompt -noverify -erase
cp -R /Volumes/highsierra/Packages /Volumes/OS\ X\ Base\ System/System/Installation
hdiutil detach /Volumes/OS\ X\ Base\ System/
hdiutil detach /Volumes/highsierra/
mv /tmp/HighSierraBase.cdr.dmg /tmp/BaseSystem.dmg
@edro15
edro15 / ForceUSBtoTTY.md
Last active April 23, 2024 00:11
[How To] Force a specific USB device to a certain TTY

Scenario:

  • multiple USB devices plugged via hub to a host (Linux OS based),
  • multiple services/programs interacting with TTY running on top (e.g. GPSd)

Problem:

At boot TTY are randomly assigned to devices causing depending services/programs instabilities. They could indeed fail to start because of different TTY configurations.

Solution:

@johngrimes
johngrimes / Dockerfile
Created February 14, 2018 22:21
Injecting environment variables into config.json using Docker
FROM nginx
COPY docker/start.sh /
COPY docker/buildConfig.sh /
RUN chmod +x /start.sh /buildConfig.sh
COPY docker/myapp.nginx.conf /etc/nginx/conf.d/default.conf
COPY build /usr/share/nginx/html
ENV MYAPP_OPTION_A="Default option A value"
#!/bin/bash
#k8setup script v1.2019.4.11
#RHEL or CentOS 7.4+
#Direct any questions to landon.key@gmail.com
#01101000 01110100 01110100 01110000 01110011 00111010 00101111 00101111 01101100 01100001 01101110 01100100 01101111 01101110 01101011 01100101 01111001 00101110 01100011 01101111 01101101 00101111
# Watch how it is used on youtube: https://youtu.be/KWehrWGjkm4
#
@levantAJ
levantAJ / extract-scheme-url.sh
Created August 7, 2019 03:20
Extract *.ipa file to looking for all scheme URLs
#!/bin/sh
RESET=`tput sgr0`
RED=`tput setaf 1`
GREEN=`tput setaf 2`
if [ "$1" ]; then
if ! [ -e "$1" ]
then
@Techbrunch
Techbrunch / microsoft-teams-presence.md
Created April 27, 2020 17:45
Microsoft Team Presence

Presence is part of a user's profile in Microsoft Teams (and throughout Office 365) that indicates the user's current availability and status to other users. By default, anyone in your organization using Teams can see (in nearly real time) if other users are available online.

Teams presence in Outlook is supported on the Outlook 2013 desktop app and later.

Source: https://docs.microsoft.com/en-us/microsoftteams/presence-admins

Request:

GET /api/mt/emea/beta/users/first.last@example.com/externalsearch HTTP/1.1
Host: teams.microsoft.com
@r3mcos3
r3mcos3 / ikea_open_close_remote.yaml
Created December 20, 2020 11:27
Home Assistant Blueprint For ZHA IKEA Open/Close Remote
blueprint:
name: IKEA Open/Close Remote
description: |
'Control your roller blind with an IKEA 2 button remote (the square ones).
this is the remote that's been delivered by the "Fytur" and " Kadrilj"
roller blinds.'
domain: automation
input:
remote:
name: Remote
@darrenjrobinson
darrenjrobinson / AADAuth_MSAL_Python.py
Last active July 7, 2024 18:10
Microsoft Graph using MSAL with Python and Certificate Authentication. Associated blogpost https://blog.darrenjrobinson.com/microsoft-graph-using-msal-with-python-and-certificate-authentication/
import msal
import jwt
import json
import sys
import requests
from datetime import datetime
global accessToken
global requestHeaders
global tokenExpiry