Skip to content

Instantly share code, notes, and snippets.

View mattleibow's full-sized avatar
🏠
Working from home

Matthew Leibowitz mattleibow

🏠
Working from home
View GitHub Profile
@mattleibow
mattleibow / gist:42c32110f161bfee0312
Created July 16, 2015 16:19
Mac NuGets in VS2015
Error occured:\nSystem.Xml.XmlException: 'Default' tag requires a nonempty 'Extension' attribute. Line 1, position 318.
at System.IO.Packaging.ZipPackage.ContentTypeHelper.ValidateXmlAttribute(String attributeName, String attributeValue, String tagName, XmlTextReader reader)
at System.IO.Packaging.ZipPackage.ContentTypeHelper.ProcessDefaultTagAttributes(XmlTextReader reader)
at System.IO.Packaging.ZipPackage.ContentTypeHelper.ParseContentTypesFile(ZipFileInfoCollection zipFiles)
at System.IO.Packaging.ZipPackage.ContentTypeHelper..ctor(ZipArchive zipArchive, IgnoredItemHelper ignoredItemHelper)
at System.IO.Packaging.ZipPackage..ctor(Stream s, FileMode mode, FileAccess access, Boolean streaming)
at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, FileAccess packageAccess, Boolean streaming)
at System.IO.Packaging.Package.Open(Stream stream)
at NuGet.OptimizedZipPackage.EnsureManifest()
at NuGet.OptimizedZipPackage..ctor(IFileSystem fileSystem, String packagePath
@mattleibow
mattleibow / gist:6956e09750d364a9a5e3
Last active August 29, 2015 14:25
WebSocket tests
using System;
using System.Threading.Tasks;
using System.Net.WebSockets;
using System.Threading;
using System.Text;
namespace testtesttest
{
class MainClass
{
Error occured:\nSystem.Xml.XmlException: 'Default' tag requires a nonempty 'Extension' attribute. Line 1, position 378.
at System.IO.Packaging.ZipPackage.ContentTypeHelper.ValidateXmlAttribute(String attributeName, String attributeValue, String tagName, XmlTextReader reader)
at System.IO.Packaging.ZipPackage.ContentTypeHelper.ProcessDefaultTagAttributes(XmlTextReader reader)
at System.IO.Packaging.ZipPackage.ContentTypeHelper.ParseContentTypesFile(ZipFileInfoCollection zipFiles)
at System.IO.Packaging.ZipPackage.ContentTypeHelper..ctor(ZipArchive zipArchive, IgnoredItemHelper ignoredItemHelper)
at System.IO.Packaging.ZipPackage..ctor(Stream s, FileMode mode, FileAccess access, Boolean streaming)
at System.IO.Packaging.Package.Open(Stream stream, FileMode packageMode, FileAccess packageAccess, Boolean streaming)
at System.IO.Packaging.Package.Open(Stream stream)
at NuGet.OptimizedZipPackage.EnsureManifest()
at NuGet.OptimizedZipPackage..ctor(IFileSystem fileSystem, String packagePath
<?xml version="1.0">
<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">
<Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" />
<Default Extension="nuspec" ContentType="application/octet" />
<Default Extension="md" ContentType="application/octet" />
<Default Extension="" ContentType="application/octet" />
<Default Extension="dll" ContentType="application/octet" />
<Default Extension="psmdcp" ContentType="application/vnd.openxmlformats-package.core-properties+xml" />
</Types>
@mattleibow
mattleibow / CompleteSSLSocketFactory.cs
Last active January 19, 2017 18:52
Using TLS 1.2 on old Androids as well as demonstrating certificate pinning
using Android.App;
using Android.OS;
using Java.Net;
using Java.Security;
using Java.Security.Cert;
using Javax.Net.Ssl;
using Square.OkHttp;
using System.Collections.Generic;
using Java.Interop;
@mattleibow
mattleibow / CertificateRequest.ini
Created July 25, 2015 04:10
The OpenSSL certifcate request used to create a self-signed certificate
# to create the .pem
# openssl.exe req -x509 -nodes -days 730 -newkey rsa:2048 -keyout cert.pem -out cert.pem -config CertificateRequest.ini
#
# to create the .pfx
# openssl.exe pkcs12 -export -out cert.pfx -in cert.pem -name "The Testing Certificate"
#
# this was imported to my IIS server and then downloaded as a .cer for use in the Android app
[req]
distinguished_name = subject
Exception thrown: 'System.InvalidCastException' in ZXingNetMobile.ni.DLL
at ZXing.Mobile.AudioVideoCaptureDeviceCameraReader.get_FlashMode()
at ZXing.Mobile.ZXingScannerControl.ToggleTorch()
at ZXing.Mobile.ScanPage.RequestToggleTorchHandler()
at ZXing.Mobile.ScanPage.RequestToggleTorch()
at ZXing.Mobile.MobileBarcodeScanner.ToggleTorch()
at ZxingSharp.WindowsPhone.Sample.MainPage.<buttonScanCustom_Click>b__5_1(Object s, RoutedEventArgs e2) in C:\Projects\nuget-testing-ground\zxing.net.mobile-2.0.2.0\samples\Sample.WindowsPhone\Sample.WindowsPhone\MainPage.xaml.cs:line 86
at System.Windows.Controls.Primitives.ButtonBase.OnClick()
at System.Windows.Controls.Button.OnClick()
at Windows.UI.Xaml.Application.LoadComponent(Object component, Uri resourceLocator, ComponentResourceLocation componentResourceLocation)
at ZXing.Mobile.ZXingScannerControl.InitializeComponent()
at ZXing.Mobile.ZXingScannerControl..ctor()
at ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingScannerViewRenderer.OnElementChanged(ElementChangedEventArgs`1 e)
at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.SetElement(VisualElement element)
at Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(VisualElement element)
at Xamarin.Forms.Platform.UWP.VisualElementPackager.OnChildAdded(Object sender, ElementEventArgs e)
at Xamarin.Forms.Platform.UWP.VisualElementPackager.Load()
at Xamarin.Forms.Platform.UWP.VisualElementRenderer`2.SetElement(VisualElement element)
at Xamarin.Forms.Platform.UWP.Platform.CreateRenderer(VisualElement element)
Environment variables being passed to the tool:
Xamarin.iOS 9.4.1 Business Edition using framework: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.2.sdk
Process exited with code 3, command:
/usr/bin/unzip -u -o -d /Users/matthew/projects/SkiaSharp/samples/Skia.Forms.Demo/iOS/obj/iPhone/Release/mtouch-cache/libskia_ios.framework /Users/matthew/projects/SkiaSharp/samples/Skia.Forms.Demo/iOS/obj/iPhone/Release/mtouch-cache/libskia_ios.framework.zip
Archive: /Users/matthew/projects/SkiaSharp/samples/Skia.Forms.Demo/iOS/obj/iPhone/Release/mtouch-cache/libskia_ios.framework.zip
error [/Users/matthew/projects/SkiaSharp/samples/Skia.Forms.Demo/iOS/obj/iPhone/Release/mtouch-cache/libskia_ios.framework.zip]: start of central directory not found;
zipfile corrupt.
(please check that you have transferred or created the zipfile in the
appropriate BINARY mode and that you have compiled UnZip properly)
//
// Options.cs
//
// Authors:
// Jonathan Pryor <jpryor@novell.com>
// Federico Di Gregorio <fog@initd.org>
// Rolf Bjarne Kvinge <rolf@xamarin.com>
//
// Copyright (C) 2008 Novell (http://www.novell.com)
// Copyright (C) 2009 Federico Di Gregorio.