Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View sheerun's full-sized avatar
🎵

Adam Stankiewicz sheerun

🎵
View GitHub Profile
@sheerun
sheerun / proxy
Last active January 25, 2024 01:11
Automatic SOCKS proxy setup through SSH connection on Mac OS X
# Script for automatic setup of SOCKS proxy through SSH connection.
# It automatically teardowns SOCKS configuration before stopping.
# It's supposed to work on Mac OS X 10.6+
#
# Author: Adam Stankiewicz (@sheerun)
#
[[ -n "$1" ]] || { echo "Usage: proxy user@example.com"; exit 1; }
# get service GUID and NAME (like Wi-Fi) to set SOCKS proxy
@sheerun
sheerun / Readme.md
Created November 3, 2023 14:45 — forked from techhazard/Readme.md
NixOS: PCI Passthrough

PCI Passthrough

Warning: unfinished (but successfull!)

I did PCI passthrough on Archlinux and Debian with the old PCI-stub method (this was pre-4.0 era). And later I did PCI passthrough on the 4.1+ kernels on Arch and Ubuntu (16.10 I think?).

This is my attempt at doing the same on Nixos.

Requirements

@sheerun
sheerun / .bowerrc
Last active March 19, 2023 02:27
Proper .bowerrc file pointing to new Bower registry (if using legacy Bower version)
{
"registry": "https://registry.bower.io"
}
@sheerun
sheerun / certgen.rb
Last active April 10, 2022 15:39
Docker TLS certificate generator
# Generates necessary certificates to ~/.docker
#
# Usage:
# bundle install
# ruby certgen.rb <domain>
require 'certificate_authority'
require 'fileutils'
if ARGV.empty?
const { performance } = require('perf_hooks');
let callback = () => {}
const ticker = (cb) => {
callback = cb
return () => {
if (callback === cb) {
callback = () => {}
@sheerun
sheerun / styles.css
Created June 25, 2020 17:17
Fix new GitHub UI (redue maximum width of navbar)
.application-main {
max-width: 1180px;
margin: 0 auto;
}
* {
border-radius: 0 !important;
box-shadow: none !important;
}
@sheerun
sheerun / click.m
Last active September 29, 2019 11:19
Script for drawing on http://editfight.com/
// Compile with:
// gcc -o click click.m -framework ApplicationServices -framework Foundation
//
// Usage:
// ./click -x pixels -y pixels
// At the given coordinates it will click and release.
//
// From http://hints.macworld.com/article.php?story=2008051406323031
#import <Foundation/Foundation.h>
#import <ApplicationServices/ApplicationServices.h>
import tensorflow as tf
import requests
import responder
import os, tempfile
# download("http://gajamed.pl/uploads/2016/04/29.jpg")
# => "/tmp/foo.jpg"
def download(url):
dest = os.path.join(tempfile.mkdtemp(), 'image.jpg')
response = requests.get(url, allow_redirects=True)
require 'open-uri'
require 'json'
require 'parallel'
packages = File.read('01.most-dependent-upon.md').scan(/\[([\w-]+)\]/m).to_a.map(&:first)
Parallel.each(packages) do |package|
begin
parsed = JSON.parse(open('https://registry.npmjs.org/' + package).read)
url = URI.parse(parsed['repository']['url'])
Error: NodeDef mentions attr 'dilations' not in Op<name=Conv2D; signature=input:T, filter:T -> output:T; attr=T:type,allowed=[DT_HALF, DT_FLOAT]; attr=strides:list(int); attr=use_cudnn_on_gpu:bool,default=true; attr=padding:string,allowed=["SAME", "VALID"]; attr=data_format:string,default="NHWC",allowed=["NHWC", "NCHW"]>; NodeDef: import/module_apply_default/MobilenetV2/Conv/Conv2D = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="SAME", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/gpu:0"](import/module_apply_default/MobilenetV2/input, import/module_apply_default/MobilenetV2/Conv/Conv2D/ReadVariableOp). (Check whether your GraphDef-interpreting binary is up to date with your GraphDef-generating binary.).
[[Node: import/module_apply_default/MobilenetV2/Conv/Conv2D = Conv2D[T=DT_FLOAT, data_format="NHWC", dilations=[1, 1, 1, 1], padding="SAME", strides=[1, 2, 2, 1], use_cudnn_on_gpu=true, _device="/job:localhost/replica:0/task:0/gpu:0"](import/m