Skip to content

Instantly share code, notes, and snippets.

Stefan Sundin stefansundin

Block or report user

Report or block stefansundin

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@stefansundin
stefansundin / heroku-replay.sh
Last active Aug 30, 2018
Replay production Heroku requests to your local dev environment.
View heroku-replay.sh
#!/bin/bash -e
app=rssbox
dev=http://rssbox.dev
heroku logs -t -s heroku -d router -a $app | {
while IFS= read -r line
do
path=$(echo $line | grep -oE 'path="([^"]+)"' | cut -d'"' -f2)
code=$(curl -s -o /dev/null -w "%{http_code}" "$dev$path")
@stefansundin
stefansundin / openssh-7.3.sh
Last active Sep 6, 2019
Install OpenSSH 7.3 in Ubuntu 16.04
View openssh-7.3.sh
$ ssh -V
OpenSSH_7.2p2 Ubuntu-4ubuntu2.1, OpenSSL 1.0.2g 1 Mar 2016
wget https://launchpadlibrarian.net/277739251/openssh-client_7.3p1-1_amd64.deb
wget https://launchpadlibrarian.net/298453050/libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453058/libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
wget https://launchpadlibrarian.net/298453060/libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libkrb5support0_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libkrb5-3_1.14.3+dfsg-2ubuntu1_amd64.deb
sudo dpkg -i libgssapi-krb5-2_1.14.3+dfsg-2ubuntu1_amd64.deb
@stefansundin
stefansundin / manifest.json
Last active Apr 25, 2017
Speed up the Wistia player automatically.
View manifest.json
{
"name": "Wistia auto-speed",
"version": "1.0",
"description": "Automatically speed up Wistia embeds to 1.5x, and select the best quality.",
"content_scripts": [
{
"matches": [
"*://*.wistia.com/medias/*",
"*://fast.wistia.net/embed/iframe/*"
],
@stefansundin
stefansundin / manifest.json
Created Mar 3, 2017
Replace the TED player with the equivalent YouTube video.
View manifest.json
{
"name": "TED YouTube embed",
"version": "1.0",
"description": "Replace the TED player with the equivalent YouTube video.",
"content_scripts": [
{
"matches": ["*://www.ted.com/talks/*"],
"js": ["replace.js"],
"run_at": "document_end"
}
View twitch-extension.lua
--[[
Twitch.tv extension v0.0.2 by Stefan Sundin
https://gist.github.com/stefansundin/c200324149bb00001fef5a252a120fc2
The only thing that this extension does is to act as a helper to seek to the
correct time when you open a twitch.tv url that contains a timestamp.
You must have the playlist parser installed as well!
Usage:
1. Install the playlist parser: https://addons.videolan.org/p/1167220/
@stefansundin
stefansundin / requests_api.py
Last active Sep 3, 2019
Reusable class for Python requests library.
View requests_api.py
# http://docs.python-requests.org/en/master/api/
import requests
class RequestsApi:
def __init__(self, base_url, **kwargs):
self.base_url = base_url
self.session = requests.Session()
for arg in kwargs:
if isinstance(kwargs[arg], dict):
kwargs[arg] = self.__deep_merge(getattr(self.session, arg), kwargs[arg])
@stefansundin
stefansundin / google-code-archive.rb
Created Aug 10, 2016
Export data from google-code-archive.
View google-code-archive.rb
#!/usr/bin/env ruby
# https://code.google.com/archive/schema
# https://storage.googleapis.com/google-code-archive/v2/code.google.com/altdrag/project.json
require "httparty"
class CodeParty
include HTTParty
base_uri "https://storage.googleapis.com/google-code-archive/v2/code.google.com"
@stefansundin
stefansundin / Gemfile
Last active Aug 10, 2016
Use rack to host a static website.
View Gemfile
source "https://rubygems.org"
gem "rack"
@stefansundin
stefansundin / manifest.json
Last active Jan 15, 2017
Replace YouPlay videos with YouTube on sweclockers.com
View manifest.json
{
"name": "SweClockers YouTube embed",
"version": "1.1",
"description": "Trött på dålig videospelare?",
"content_scripts": [
{
"matches": ["*://www.sweclockers.com/*"],
"js": ["replace.js"],
"run_at": "document_end"
}
@stefansundin
stefansundin / compile-truecrypt-tails.md
Created May 15, 2016
Compile truecrypt in tails 2.3
View compile-truecrypt-tails.md

compile truecrypt in tails 2.3

sudo apt-get install git build-essential devscripts debhelper pkg-config libgtk2.0-dev libfuse-dev nasm libappindicator-dev bash-completion
sudo apt-get install fakeroot

remove $(LIBS) from Main.make line 108 i.e. result: $(APPNAME): $(OBJS)

You can’t perform that action at this time.