Skip to content

Instantly share code, notes, and snippets.

View mschewe's full-sized avatar

Mark Schewe mschewe

  • snabble.io
  • Bonn, Germany
  • 00:07 (UTC +02:00)
View GitHub Profile
@mschewe
mschewe / __layout.svelte
Created May 17, 2021 07:18
firebase auth attempt with svelte kit
<script context="module" lang="ts">
import { authGuard } from '../auth/guard';
import type { LoadInput, LoadOutput } from '@sveltejs/kit/types/page';
export async function load({ page, fetch, session, context }: LoadInput): Promise<LoadOutput> {
return await authGuard({ page, fetch, session, context });
}
</script>
<script lang="ts">
@mschewe
mschewe / gst_tools_examples.sh
Created June 19, 2018 12:37 — forked from sepastian/gst_tools_examples.sh
Use gst-launch (gstreamer-tools) to capture single images and stream video from the command-line.
# Capture a single image and save it in JPEG format.
$ gst-launch v4l2src num-buffers=1 ! jpegenc ! filesink location=/tmp/test.jpg
# Stream video from a webcam.
$ gst-launch v4l2src ! xvimagesink
44-75-73-73-6D-61-6E-6E-20-53-65-72-76-69-63-65-1D-21-00-0D-0A-1B-45-01-69-6D-2
0-48-61-75-73-65--0D-0A-1B-45-01-43-6F-63-61-20-43-6F-6C-61-20-42-65-72-6C-69-6E
--0D-0A-1B-45-01-53-74-72-61-6C-61-75-65-72-20-41-6C-6C-65-65-20-34--0D-0A-1B-45
-01-55-73-74-2D-49-44-3A-31-32-33-34-35-36-37-38-39-30--0D-0A-0D-0A-1B-45-01-4B-
6F-70-69-65-20-23-33--0D-0A-1B-24-00-00-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2
D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-
2D-2D-0D-0A-52-65-63-68-6E-75-6E-67-73-2D-4E-72-2E-3A-20-36-35-36-38-32-1B-24-38
-01-31-34-2E-30-36-2E-32-30-31-38-20-31-39-3A-30-31-0D-0A-1B-24-00-00-4B-61-73-7
3-65-3A-20-32-1B-24-A4-01-53-68-6F-70-3A-20-31-0D-0A-1B-24-00-00-2D-2D-2D-2D-2D-
2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D-2D
@mschewe
mschewe / bluetooth_serial.md
Created April 12, 2017 09:53 — forked from 0/bluetooth_serial.md
Connecting a Bluetooth device for serial communication on Arch Linux.

The following are instructions for connecting a Bluetooth device for serial communication on Arch Linux using BlueZ 5.31.

Prerequisites

The following packages are required:

  • bluez: bluetoothd
  • bluez-utils: bluetoothctl, rfcomm
@mschewe
mschewe / Dockerfile
Created March 6, 2017 14:26 — forked from VictorLaskin/Dockerfile
Compile static libs: OpenSSL and CURL with https support for Android using clang3.6 (armv7)
# THIS DOCKERFILE TRIES TO COMPILE CURL/OPENSSL FOR ANDROID
#
# 5 july 2015
#
# More detals could be found here:
# http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/
FROM ubuntu
MAINTAINER Victor Laskin "victor.laskin@gmail.com"
@mschewe
mschewe / Dockerfile
Created March 6, 2017 14:26 — forked from VictorLaskin/Dockerfile
Compile static libs: OpenSSL and CURL with https support for Android using clang3.6 (armv7)
# THIS DOCKERFILE TRIES TO COMPILE CURL/OPENSSL FOR ANDROID
#
# 5 july 2015
#
# More detals could be found here:
# http://vitiy.info/dockerfile-example-to-compile-libcurl-for-android-inside-docker-container/
FROM ubuntu
MAINTAINER Victor Laskin "victor.laskin@gmail.com"
I am having some problems connecting with Giganews VyprVPN service.
As you can see in the output.txt it all seems to work.
Some services like speedtest.net use the correct VPN location.
Others like Google Analaystics can still detect my real location.
I believe this have something to do with my setup:
ArchLinux - 4.7.5-1-ARCH
openvpn --version 1 ↵
@mschewe
mschewe / howto-detumblrize.mkd
Created September 21, 2016 20:20 — forked from jaredhirsch/howto-detumblrize.mkd
Downloading stuff off of tumblr

TL;DR skip to the summary for the bash one-liner if so inclined :-)

Why & wherefore

I have an old tumblr that I want to back up. I don't use it regularly, but I want to have a backup of the whole site, design as well as content, just in case; it's not just the pictures I love, but the whole thing. I'm not particularly worried about downloading the streaming audio--can't help you there, gentle reader.

Remove a long running sidekiq job from the redis database

  • Stop all workers This forces the worker to write the job again into the redis database.

  • Find the matching queue smembers queues

1) "default"
2) "mailers"
@mschewe
mschewe / rspec_model_testing_template.rb
Created February 12, 2016 08:46 — forked from SabretWoW/rspec_model_testing_template.rb
Rails Rspec model testing skeleton & cheat sheet using rspec-rails, shoulda-matchers, shoulda-callbacks, and factory_girl_rails. Pretty much a brain dump of examples of what you can (should?) test in a model. Pick & choose what you like, and please let me know if there are any errors or new/changed features out there. Reddit comment thread: http…
# This is a skeleton for testing models including examples of validations, callbacks,
# scopes, instance & class methods, associations, and more.
# Pick and choose what you want, as all models don't NEED to be tested at this depth.
#
# I'm always eager to hear new tips & suggestions as I'm still new to testing,
# so if you have any, please share!
#
# @kyletcarlson
#
# This skeleton also assumes you're using the following gems: