Skip to content

Instantly share code, notes, and snippets.

View Pk13055's full-sized avatar
🇦🇪
Focusing

Pk13055

🇦🇪
Focusing
View GitHub Profile
@tichnas
tichnas / duplicateMilestones.sh
Last active July 6, 2021 20:03
Duplicate milestones from one repo to another.
#!/bin/bash
source="$1"
destination="$2"
cwd="$PWD"
cd "$source"
milestones=$(gh listMilestones | jq ".data.repository.milestones.nodes" | jq -c ".[]")
import streamlit as st
import os
import sys
import importlib.util
# Parse command-line arguments.
if len(sys.argv) > 1:
folder = os.path.abspath(sys.argv[1])
else:
folder = os.path.abspath(os.getcwd())
import os
import signal
import subprocess
import sys
# Parse command-line arguments.
if len(sys.argv) > 1:
folder = os.path.abspath(sys.argv[1])
else:
folder = os.path.abspath(os.getcwd())
@mrbrutti
mrbrutti / TensorMini.md
Last active May 21, 2023 05:02
Deep Learning with a Mac Mini + Akitio Titan XP + Ubuntu 17.10

Introduction

I've been doing a lot of research into Deep Reinforcement Learning, Machine Learning and other areas. Without much non-apple hardware laying around. I have spent countless hours rebuilding tensorflow 1.3-1.7 from source with all of the known .diff changes required and the constant rebuilding effords in order to get things working. I tried moving to Linux on the machines, but sadly neither the MacPro or the Macbook Pro 2017 supports Linux that well nor the supported the Nvidia egpu on previous versions of ubuntu.

But then comes 2018 and I got back from one of my MacMini and I decided to try with it. I have heard people having luck with ubuntu 17.10 on a NUC and thought it would be a good idea to try.

@shimon
shimon / fix-webcams.sh
Created January 25, 2018 22:54
Linux shell script to disable an internal webcam if an external one is attached, or enable the internal one if not.
#!/bin/bash
# Quick script to disable an internal webcam if an external one is attached, or
# enable the internal one if the external one's not attached.
# by Shimon Rura, 25 Jan 2018. In the public domain.
# To use, run `lsusb` and identify the lines for your internal and external camera devices.
# For example, mine are:
# internal:
@Pk13055
Pk13055 / nginxproxy.md
Created January 20, 2018 22:38 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

from matplotlib import pyplot as plt
import cv2
img = cv2.imread('/Users/mustafa/test.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
plt.imshow(gray)
plt.title('my picture')
plt.show()
@cboettig
cboettig / docker-compose.yml
Last active March 8, 2025 20:25
debugging NGINX configuration for Jupyter
jupyter:
image: jupyter/datascience-notebook
environment:
- PASSWORD=${PASSWORD}
nginx:
image: nginx
links:
- jupyter
@vishaltelangre
vishaltelangre / nginx_assets.md
Last active October 3, 2023 19:30
Serving Static Assets via Nginx

Concept

  • People talk about two servers: a web server (e.g. Nginx, Apache, etc.) and a app server (e.g. Language specific servers like Unicorn, Node.js, Tomcat, Http-Kit, etc.). There are exceptions where app servers not required at all (as web server itself provides preprocessors for handling), but let's not talk about now.
  • Web servers are really fast and supports lot of standard and commonly used MIME-type requests. Concept of serving a file is -- forming and sending a response of bytes of data and labeling it with requested MIME-type by a client (e.g. web browser).
  • Every response format (in layman's language, a file) is recognized by it's MIME-type, for e.g. a PNG image file has "image/png" MIME-type. JavaScript file has "text/javascript". HTML responses (or files) has "text/html". Plain text files have "text/plain".
  • Modern Browsers supports a lot of standard MIME-types. Images, videos, text files (XML, HTML, SVG, JS), and they better know how to visualize it. Browser also knows unrec
@soheilhy
soheilhy / nginxproxy.md
Last active April 11, 2025 06:29
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers