Skip to content

Instantly share code, notes, and snippets.

View cybniv's full-sized avatar
📚
reading

Marvin Schlegel cybniv

📚
reading
View GitHub Profile
@cybniv
cybniv / popcorntime-vpn.sh
Created October 21, 2018 20:37 — forked from Schnouki/popcorntime-vpn.sh
OpenVPN for a single application using network namespaces -- helper scripts
#!/usr/bin/env zsh
# Initialize VPN
sudo vpnns up
sudo vpnns start_vpn
# Popcorn time!
sudo ip netns exec frootvpn sudo -u $USER popcorntime
# Cleanup
@cybniv
cybniv / dock
Last active October 23, 2018 07:39
dock to docking station
#!/usr/bin/env ruby
@enabled_outputs = ["eDP1", "DP1-1", "DP1-2", "DP1-3", "HDMI1", "HDMI2", "HDMI3", "VGA1"]
@max_enabled_outputs = 2
@position = '--right-of'
# A connected output looks like this 'HDMI1 connected[...]'
def get_connected_outputs(xrandr_output)
outputs = []
@cybniv
cybniv / calibre_meta
Created October 22, 2018 22:54
calibre persist metadata in pdf
#!/usr/bin/env ruby
files = Dir.glob(ENV['HOME'] + "/Calibre Library/**/*.pdf")
# meta = Dir.glob(ENV['HOME'] + "/Calibre Library/**/metadata.opf")
dirs = []
for file in files
dirs << [ File.dirname(file), File.basename(file) ]
end

Keybase proof

I hereby claim:

  • I am jackrandom on github.
  • I am ms3000 (https://keybase.io/ms3000) on keybase.
  • I have a public key ASBCSHOGAOvguYk4Ne0gREQYdT7-rw6jw_Ia6Muuvpn4Vwo

To claim this, I am signing this object:

@cybniv
cybniv / tidal_download
Created March 24, 2019 15:23
this script extracts unencrypted FLACs from an Android device running Tidal.
#!/usr/bin/env ruby
require 'bundler/inline'
gemfile do
ruby '>=2.5'
source 'https://rubygems.org'
gem 'rb-inotify'
gem 'pry-byebug'
end
@cybniv
cybniv / 1.9.3-p551_patchset
Last active March 25, 2019 17:50
for use with asdf RUBY_APPLY_PATCHES
https://raw.githubusercontent.com/rvm/rvm/master/patches/ruby/GH-488.patch
https://raw.githubusercontent.com/rvm/rvm/master/patches/ruby/1.9.3/CVE-2015-1855-p484.patch
https://raw.githubusercontent.com/rvm/rvm/master/patches/ruby/1.9.3/update-autoconf.patch
https://raw.githubusercontent.com/rvm/rvm/master/patches/ruby/1.9.3/openssl3.patch
@cybniv
cybniv / 1.9.3-p551.patch
Created April 2, 2019 00:29
1.9.3-p551 patch (SSLv3, TLS 1.1/2 support, CVE-2015-1855 fix backport)
diff --git a/ext/openssl/extconf.rb b/ext/openssl/extconf.rb
index bfb1ea4..eaa2557 100644
--- a/ext/openssl/extconf.rb
+++ b/ext/openssl/extconf.rb
@@ -104,6 +104,15 @@ have_func("OPENSSL_cleanse")
have_func("SSLv2_method")
have_func("SSLv2_server_method")
have_func("SSLv2_client_method")
+have_func("SSLv3_method")
+have_func("SSLv3_server_method")
@cybniv
cybniv / install_terminfo_from_21st_century.sh
Created June 26, 2019 20:17
fix terminfo on shit-fucked debianish systems from middle-earth
#!/bin/sh
### btw I use arch
curl -O https://invisible-island.net/datafiles/current/terminfo.src.gz
gunzip terminfo.src.gz
tic -sx terminfo.src
@cybniv
cybniv / mozlz4a.py
Created August 3, 2019 08:53 — forked from kaefer3000/mozlz4a.py
MozLz4a compression/decompression utility
#!/usr/bin/env python
#
# Decompressor/compressor for files in Mozilla's "mozLz4" format. Firefox uses this file format to
# compress e. g. bookmark backups (*.jsonlz4).
#
# This file format is in fact just plain LZ4 data with a custom header (magic number [8 bytes] and
# uncompressed file size [4 bytes, little endian]).
#
# This Python 3 script requires the LZ4 bindings for Python, see: https://pypi.python.org/pypi/lz4
#
@cybniv
cybniv / update.sh
Created September 1, 2019 09:06 — forked from jeremy-wolfe/update.sh
ProtonMail Bridge Updater for Arch Linux
#!/bin/bash
# Should work with your favorite hash algorithm (md5sum, sha256sum, etc.)
hash=md5sum
old="$($hash PKGBUILD)"
wget -O PKGBUILD https://protonmail.com/download/beta/PKGBUILD
new="$($hash PKGBUILD)"
[ "$old" = "$new" ] && echo "Up to date." || makepkg -si