Skip to content

Instantly share code, notes, and snippets.

View m2sh's full-sized avatar
🤔
hmm!

Mohammad Shahgolzadeh m2sh

🤔
hmm!
View GitHub Profile
@harlow
harlow / golang_job_queue.md
Last active April 24, 2024 10:21
Job queues in Golang
@superjamie
superjamie / raspberry-pi-vpn-router.md
Last active April 13, 2024 12:22
Raspberry Pi VPN Router

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

@oldo
oldo / video-metada-finder.py
Last active March 2, 2023 22:33
A python function utilising `ffprobe` to find any metadata related to a video file. Examples of what it can find include bitrate, fps, codec details, duration and many more. This gist returns the video height and width as an example.
#!/usr/local/bin/python3
import subprocess
import shlex
import json
# function to find the resolution of the input video file
def findVideoMetada(pathToInputVideo):
cmd = "ffprobe -v quiet -print_format json -show_streams"
args = shlex.split(cmd)
args.append(pathToInputVideo)
@viktorsteinwand
viktorsteinwand / Easy access to composer docker image
Last active February 17, 2016 20:56
Easy access to composer/composer docker image
# This shell script can be used for easier accessing the composer/composer docker image (https://hub.docker.com/r/composer/composer/)
Create new composer file
```sh
sudo vim /usr/local/bin/composer
```
The contents of the file will look like this:
```sh
@pjamar
pjamar / sniproxy.md
Created January 7, 2016 18:38
SNI Proxy Tutorial

SNI Proxy for sharing an SSL port 443 with Sandstorm

Make Sandstorm and other web server coexist in the same port while keeping HTTPS encryption.

Introduction

The purpose of this tutorial is to set up SNI Proxy so it’s possible to use Sandstorm verified SSL encryption while coexisting with another web server that also uses SSL.

The main reason is to allow other users to connect with your Sandstorm instance in the standard HTTPS port (443) and keep using that port also for any other web apps.

@evantoli
evantoli / GitConfigHttpProxy.md
Last active May 11, 2024 07:51
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@charanpald
charanpald / deeplearning.py
Created January 20, 2016 20:48
An example of deep learning on the digits dataset using Keras
import numpy
import pandas
from sklearn.datasets import load_digits
from sklearn import preprocessing
from sklearn.cross_validation import KFold
from sklearn.svm import SVC
from sklearn.metrics import zero_one_loss
from keras.models import Sequential
from keras.layers.core import Dense, Activation
import EventEmitter from "events";
let priv = new WeakMap();
let simulatorCoords = [
[40.678178, -73.944158],
[40.678181, -73.943267],
[40.678083, -73.941593],
[40.678034, -73.940649],
];
let index = 0;
@egorf
egorf / bluetoothctl.py
Created March 22, 2016 10:30
Bluetoothctl wrapper in Python
# ReachView code is placed under the GPL license.
# Written by Egor Fedorov (egor.fedorov@emlid.com)
# Copyright (c) 2015, Emlid Limited
# All rights reserved.
# If you are interested in using ReachView code as a part of a
# closed source project, please contact Emlid Limited (info@emlid.com).
# This file is part of ReachView.
@urish
urish / neopixel.ino
Last active November 6, 2021 20:16
Simple NeoPixel Animation for Arduino on WeMos D1 Mini, License: MIT
#include <Adafruit_NeoPixel.h>
#define NUM_PIXELS 24
Adafruit_NeoPixel pixels(NUM_PIXELS, D2, NEO_GRB | NEO_KHZ800);
void setup() {
pixels.begin();
}