Skip to content

Instantly share code, notes, and snippets.

View senz's full-sized avatar

Kosta senz

  • Freelance consulting and dev
  • Netherlands
View GitHub Profile
@senz
senz / README.md
Created July 19, 2023 16:54
Invidious in docker (with traefik)

Guide to setup Invidious instance using docker and traefik

  1. setup traefik This is a bit out of the scope of this guide. I set traefik outside of this docker compose file, since its beign used by many separate setups on my machine. But you can put traefik in the same override file, if you do not intend to use it for other service (but it makes no sense to use it at all in that case). I use combination os OSX's /etc/resolver and dnsmasq to resolve subdomain.test. tld to localhost adresses.

  2. clone repo https://github.com/iv-org/invidious/

  3. comment out "ports:" section of invidious service. Unfortunately there is no way to override it.

@senz
senz / gogs_migrate.sh
Created August 8, 2017 09:41
gogs repo migration script
#!/usr/bin/env bash
## Usage:
## ./migrate.sh $clone_url $project_name $owner_uid
## Migrate a repository to gogs into the user namespace of the token-user
## ./migrate.sh git@mygitlab.com:group/repo.git repo 1
## uid can be a group uid
## NB: for local migration, if your gogs instance is inside docker or vm, you must provide path local relative to container's fs
echo $1;
@senz
senz / ginny.conf.js
Created March 21, 2017 14:44
hermione firefox profile
const fs = require('fs');
let profile = fs.readFileSync(process.cwd() + '/firefox_profile.zip').toString('base64');
module.exports = {
hermione: {
browsers: {
firefox: {
desiredCapabilities: {
browserName: "firefox",
firefox_profile: profile
@senz
senz / blockconfig.php
Last active June 11, 2016 18:57
P2P i-Blocklist generator uses unix gzip and sort
<?php
return [
'list' => [
['http://list.iblocklist.com/?list=ydxerpxkpcfqjaybcssw&fileformat=p2p&archiveformat=gz', 'p2p', 'gz', 'bluetack-level1'],
['http://list.iblocklist.com/?list=gyisgnzbhppbvsphucsw&fileformat=p2p&archiveformat=gz', 'p2p', 'gz', 'bluetack-level2'],
['http://list.iblocklist.com/?list=plkehquoahljmyxjixpu&fileformat=p2p&archiveformat=gz', 'p2p', 'gz', 'bluetack-suspicious'],
['http://list.iblocklist.com/?list=xshktygkujudfnjfioro&fileformat=p2p&archiveformat=gz', 'p2p', 'gz', 'bluetack-microsoft'],
['http://list.iblocklist.com/?list=gihxqmhyunbxhbmgqrla&fileformat=p2p&archiveformat=gz', 'p2p', 'gz', 'blutack-bogon'],
['http://list.iblocklist.com/?list=lujdnbasfaaixitgmxpp&fileformat=p2p&archiveformat=gz', 'p2p', 'gz', 'cidr-report.org-bogon'],
['http://list.iblocklist.com/?list=cwworuawihqvocglcoss&fileformat=p2p&archiveformat=gz', 'p2p', 'gz', 'bluetack-badpeers'],
@senz
senz / docker-machine.php
Created April 25, 2016 08:12
Ansible dynamic inventory for docker-machine written in PHP
#!/usr/bin/php
<?php
/**
* Created by IntelliJ IDEA.
* User: senz
* Date: 24.04.16
* Time: 14:54
*/
$opts = getopt('', [
@senz
senz / fancy_shepard_tone.rb
Created April 3, 2016 17:51
Shepard tone Sonic Pi code
# github.com/senz
use_synth :mod_sine
use_bpm 40
counter = 0
v1l = [:C3, :D3, :E3, :F3, :G3, :A3, :B3].ring
v2l = [:C4, :D4, :E4, :F4, :G4, :A4, :B4].ring
v3l = [:C5, :D5, :E5, :F5, :G5, :A5, :B5].ring
a = 1
@senz
senz / ExtendedMixpanelAPI.scala
Created July 17, 2015 12:15
Mixpanel API supporting extension and sending ip address
package com.mixpanel.mixpanelapi
import java.io._
import java.net.{URLEncoder, URLConnection, URL, InetAddress}
import scala.collection.JavaConverters._
import org.json.{JSONArray, JSONObject}
class ExtendedMixpanelAPI(protected final val eventsEndpoint: String, protected final val peopleEndpoint: String) {
/**
@senz
senz / get-global-and-strict.html
Created August 7, 2013 09:05
getting global object from random places and behavior in strict mode
<html>
<body>
<script>
"use strict";
var obj = {lolo: 1};
console.log("ljambda this in strict:", (function(){ return this === undefined; })());
(function() {
console.log("current context:", this);
var Fn = Function, global = new Fn('"use strict"; return this')();
console.log("evaled func this is (strict): ", global);
@senz
senz / cookie-test
Created June 7, 2012 13:19
Cookie max size detection