Skip to content

Instantly share code, notes, and snippets.

View mschewe's full-sized avatar

Mark Schewe mschewe

  • snabble.io
  • Bonn, Germany
  • 00:23 (UTC +02:00)
View GitHub Profile
@mschewe
mschewe / brightness.sh
Last active December 12, 2015 06:39
Helper script to set the screen brightness on a Lenovo T530
#!/bin/bash
BRIGHTNESS=/sys/devices/pci0000:00/0000:00:02.0/backlight/acpi_video0/brightness
CURRENT_VALUE=$(cat $BRIGHTNESS)
value=$(echo $1 | grep -E -o '[[:digit:]]+')
if [[ $# -ne 1 ]]
then
echo "$0 +VALUE | -VALUE | VALUE"
@mschewe
mschewe / app.js
Created May 18, 2015 22:20
Sample application of gorilla/websocket and labstack/echo
$(function(){
connect = function() {
ws = new WebSocket("ws://" + window.location.host + "/ws");
ws.onopen = function(e) {
console.log("onopen", arguments);
};
ws.onclose = function(e) {
@mschewe
mschewe / springer-free-maths-books.md
Created December 29, 2015 12:24 — forked from bishboria/springer-free-maths-books.md
Springer have made a bunch of books available for free, here are the direct links
@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:

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 / 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.

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 / 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"
@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