Skip to content

Instantly share code, notes, and snippets.

@tobiasviehweger
tobiasviehweger / manifest.json
Created March 30, 2023 17:15
New RSC Teams app manifest
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.13/MicrosoftTeams.schema.json",
"manifestVersion": "1.13",
"version": "1.0.1",
"id": "6402de97-ce33-4386-bf28-b37e9e139c12",
"packageName": "test-package",
"developer": {
"name": "Test",
"websiteUrl": "https://test.com",
"privacyUrl": "https://test.com/privacy-policy-services",
@tobiasviehweger
tobiasviehweger / manifest.json
Created March 30, 2023 17:14
Old Teams RSC Manifest (working)
{
"$schema": "https://developer.microsoft.com/en-us/json-schemas/teams/v1.11/MicrosoftTeams.schema.json",
"manifestVersion": "1.11",
"version": "1.0.1",
"id": "6402de97-ce33-4386-bf28-b37e9e139c11",
"packageName": "test-package",
"developer": {
"name": "Test",
"websiteUrl": "https://test.com",
"privacyUrl": "https://test.com/privacy-policy-services",
@tobiasviehweger
tobiasviehweger / auth_sharepointonline.py
Created July 3, 2018 14:08 — forked from brianrusso/auth_sharepointonline.py
Quick and dirty example of how to authenticate to Office 365 SharePoint Online using urllib2, jinja2, cookielib. Basically you POST your user/pass to Microsoft's token service, then hand that token to SharePoint's login proper, which gives you a cookie to access SharePoint content.
import urllib2
import cookielib
import urlparse
import jinja2
from urllib2 import HTTPCookieProcessor
from lxml import etree
# Setup Jinja for SAML
JINJA_TEMPLATE_PATH = "/Users/Brian/IdeaProjects/yggdrasil/templates"
JINJA_ENVIRONMENT = jinja2.Environment(
@tobiasviehweger
tobiasviehweger / CreateUnifiedGroup.xml
Created January 8, 2018 21:48
Undocumented EWS calls related to Outlook Groups (Creation, Validation, Retrieval)
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<RequestServerVersion Version="Exchange2015" xmlns="http://schemas.microsoft.com/exchange/services/2006/types"/>
<MailboxCulture xmlns="http://schemas.microsoft.com/exchange/services/2006/types">en-US</MailboxCulture>
</s:Header>
<s:Body>
<ValidateUnifiedGroupAlias xmlns="http://schemas.microsoft.com/exchange/services/2006/messages">
<Alias>StrideTest4</Alias>
</ValidateUnifiedGroupAlias>
</s:Body>
@tobiasviehweger
tobiasviehweger / adb_fire_tv_play_netflix_show.sh
Created June 18, 2017 10:18
ADB command to start Netflix app on FireTV/FireTV Stick and automatically start playing next episode of show #80025384
adb shell am start -n com.netflix.ninja/.MainActivity -a android.intent.action.VIEW -d netflix://title/80025384 -f 0x10000020 -e "amzn_deeplink_data" "80025384"
Creating file hash + signature with OpenSSL:
openssl dgst -sha256 -binary <infile> > <infile>.hash
openssl rsautl -sign -inkey somekey.pfx -keyform pkcs12 -passin pass:<password> -in <infile>.hash > <infile>.sig
rm <infile>.hash
Validating the signature from C#, using both <infile> and <infile>.sig
var cert = new X509Certificate2( .. somesource .. );
var csp = (RSACryptoServiceProvider) cert.PublicKey.Key;
Updater - Dependency Mgmt @ Runtime - Possibility to roll back updates @ runtime?
Idea example:
- Let's say, we want to update the application. Instead of the single event it was before, it's much more dynamic
-> Download a new version of the library part (e.g. StoreEventHandling.dll v1.1 from 1.0)
-> Download all depedent updates if there are any (e.g. StoreEventHandling.dll 1.1 requires core 1.2)
-> Now this won't be live on next launch, but can be controlled via some meta data
-> This enables us to test an update, but when something important fails, we can go back to the previous version anytime
-> This is either controlled by a central update server or by the client, based on some metrics (increased error count something something)
@tobiasviehweger
tobiasviehweger / postgres.ps1
Last active September 22, 2015 06:28
Spin up local postgres
# Assumes postgres binaries in .postgres subfolder
# http://get.enterprisedb.com/postgresql/postgresql-9.4.1-3-windows-x64-binaries.zip
$targetPath = $PSScriptRoot + "\.postgres\"
$env:Path = $targetPath + "pgsql\bin;" + $env:Path
$env:PGDATA = $targetPath + "data"
$env:PGDATABASE = "postgres"
$env:PGUSER = "postgres"
$env:PGPORT = "1338"
$env:PGLOCALEDIR = $targetPath + "pgsql\share\locale"
@tobiasviehweger
tobiasviehweger / OOXMLTest.cs
Created May 21, 2015 10:03
Parsing Outlook WordOpenXML to OOXML SDK objects
using DocumentFormat.OpenXml.Packaging;
using DocumentFormat.OpenXml.Wordprocessing;
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Packaging;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;
@tobiasviehweger
tobiasviehweger / OutlookPSTStoreTodos.cs
Created May 5, 2015 10:11
Enable "Display reminders and tasks from this folder in the To-Do bar" for PST Store programatically
private void EnableStoreTodosAndReminders(RDOStore store)
{
//Enable store for reminders
var reminders = store.Reminders;
reminders.EnableStoreReminders();
//Collection some folders we need
var rootFolder = store.RootFolder;
var taskFolder = store.GetDefaultFolder(rdoDefaultFolders.olFolderTasks);
var inbox = store.GetDefaultFolder(rdoDefaultFolders.olFolderInbox);