Skip to content

Instantly share code, notes, and snippets.

View jackvial's full-sized avatar

Jack Vial jackvial

View GitHub Profile
@jackvial
jackvial / gist:f8d42eff4c005bc0e7403e025d040327
Created January 18, 2023 01:23 — forked from vijinho/gist:2a59d7660ecc0c7d8c2b
MacOS X nginx SSL Proxy Setup

#Installing nginx on OS X

brew install nginx
sudo cp -v /usr/local/opt/nginx/*.plist /Library/LaunchDaemons/
sudo chown root:wheel /Library/LaunchDaemons/homebrew.mxcl.nginx.plist
mkdir -p /usr/local/etc/nginx/logs
mkdir -p /usr/local/etc/nginx/sites-available
mkdir -p /usr/local/etc/nginx/sites-enabled
mkdir -p /usr/local/etc/nginx/conf.d
mkdir -p /usr/local/etc/nginx/ssl

Ubuntu 22.04 for Deep Learning

In the name of God

This gist contains steps to setup Ubuntu 22.04 for deep learning.


Install Ubuntu 22.04

@jackvial
jackvial / machine_learning_deep_learning.md
Created June 23, 2018 17:20
Machine Learning and Deep Learning Courses

Machine Learning / Deep Learning

DataCamp.com (Data Scientist with Python track)

  • Intro to Python for data science (course 1)
  • Intermediate Python for Data Science (course 2)
  • Statistical Thinking in Python part 1 and 2 (courses 15 and 16) (kinda optional)
  • Supervised Learning with scikit-learn (Course 18)
    • Trying using what you learned in course 18 to Kaggle Titanic and Housing Prices challenges
  • Deep Learning in Python (course 21)
    • Trying using you learned in course 21 to Kaggle MNIST challenge

Remote Jupyter Notebook

$laptop: ssh -l <username>@<yourNewServerIP>
$server: jupyter notebook --no-browser --port=8888
$laptop: ssh -NL 8888:localhost:8888 <username>@<yourNewServerIP>

Then you can goto http://localhost:8888 on your laptop’s browser and remotely view/edit your Jupyter notebooks.

This test can help identify the following issues:

  • Internal short circuits
  • Failed components
  • Power connected to PSU

What this test cannot identify:

  • Voltage fluctuations
  • Overheating
  • Power Output (failing power rails)
@jackvial
jackvial / gist:991ec75ab0e95fb7499d6f18a39b4982
Created February 22, 2018 16:50 — forked from tobek/get-image-urls.js
Save images from chrome inspector network tab
/* right click on an entry in the network log, select Copy All as Har
* type in console: x = [paste]
* paste the following JS code into the console
* copy the output, paste into a file
* then wget -i [that file]
*/
(function(logObj, mime) {
var results = [];
logObj.log.entries.forEach(function (entry) {
if (mime && entry.response.content.mimeType !== mime) return;
@jackvial
jackvial / NewMessage.php
Created February 13, 2018 14:53 — forked from sebastiaanluca/NewMessage.php
Laravel + Redis + NodeJS + Socket.io pub/sub secure server and client supporting multiple rooms, channels, users, … Add `client.js` to your client app, run `node server.js`, and trigger the Laravel event any way you want to broadcast the data.
<?php
namespace App\Events;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Queue\SerializesModels;
class NewMessage extends Event implements ShouldBroadcast
{
@jackvial
jackvial / postgres-setup.md
Last active November 10, 2022 21:25
Laravel Postgres Setup

Postgres Setup

Step 1: Install PostgreSQL

Here are the installation steps on Ubuntu (this installation will also work on any Debian-based distribution):

  1. Open a terminal window.
  2. Issue the command sudo apt-get install postgresql.
  3. Type the sudo password necessary to give you admin rights and hit Enter.
  4. Allow apt to pick up any necessary dependencies.
@jackvial
jackvial / ecdf.py
Last active October 8, 2017 00:41
Python ECDF
def ecdf(data):
"""Compute ECDF for a one-dimensional array of measurements."""
# Number of data points: n
n = len(data)
# x-data for the ECDF: x
x = np.sort(data)
# y-data for the ECDF: y
@jackvial
jackvial / repo-proposal.md
Created June 27, 2017 19:42 — forked from thewinterwind/repo-proposal.md
Proposal for service platform and repository pattern

Service Platform w/ Repository Pattern Proposal

This document will outline a proposal for a service platform (API) and a repository pattern as a business layer for IC.

Benefits

  • Have a data layer that is independent of models and controllers.
  • Have repo methods that can be consumed from other parts of the web application and from the command line.
  • Reduce logic in controllers and models, allowing controllers to focus on HTTP level work (request data, cookies, responses) and models to focus on creating relationships, casting columns, mutators, etc. The controllers should instead delegate work to the repos.
  • Repository methods can be reused by different parts of the web application and to perform work for an API request coming from outside (i.e. if we use a mobile platform like React Native it can call the API endpoints which in turn consume the repositories)
  • Have repo methods be easily unit tested as they will not be accessing session data, request data or external constants. They only