Skip to content

Instantly share code, notes, and snippets.

View toshihiroryuu's full-sized avatar
🏆
GitHub Champion

Athul Mathew toshihiroryuu

🏆
GitHub Champion
View GitHub Profile
'''
------------------------------------------------------------------------------
File name : insta_downloader.py
Description : Dowload all conetents from instagram
Python Version : 3.6.2
Copyright : Open Source (MIT)
------------------------------------------------------------------------------
Version Date Author Remarks
1.1 15-July-2020 Athul Mathew Created
------------------------------------------------------------------------------
from multiprocessing.process import Process
import time
import redis
def pub(myredis):
for n in range(10):
myredis.publish('channel','blah %d' % n)
time.sleep(5)
def sub(myredis, name):
@toshihiroryuu
toshihiroryuu / CUDA Installation GPU Machine Personal Check
Last active August 19, 2019 06:12
CUDA Installation GPU Machine Personal Check
Building Caffe
Before Caffe can be build, Protobuf 3 needs to be build.
For best performance, you'll want:
• One or more NVIDIA GPUs - GeForce RTX 2080 Ti present
• An NVIDIA driver - NVIDIA-SMI 410.57 present
• A CUDA toolkit – to be installed
• cuDNN – to be installed
Building Protobuf :
To run Caffe and Tensorflow inside DIGITS side by side, protobuf 3 must be built from source.
500 Internal Server Error – Analysis
1. [Python] Flask Web App in Azure throws (Internal Server Error)
Firstly, it works fine locally on my computer.
So I tried to deploy my website to azure Web App, it deployed successfully, but it shows 'Internal Server Error' as I try to browse it. Checked logs and didn't find any specific problem. Here's wsgi log:
2016-10-16 16:34:09.476620: Activating venv with executable at D:\home\site\wwwroot\env\Scripts\python.exe
2016-10-16 16:34:09.507951: Getting handler Test_Azure.app
2016-10-16 16:34:10.242244: Activating venv with executable at D:\home\site\wwwroot\env\Scripts\python.exe
2016-10-16 16:34:10.257894: Getting handler Test_Azure.app
Introduction
Nginx is one of the most popular web servers in the world and is responsible for hosting some of the largest and highest-traffic sites on the internet. It is more resource-friendly than Apache in most cases and can be used as a web server or a reverse proxy.
In this guide, we'll discuss how to get Nginx installed on your Ubuntu 16.04 server.
Prerequisites
Before you begin this guide, you should have a regular, non-root user with sudo privileges configured on your server. You can learn how to configure a regular user account by following our initial server setup guide for Ubuntu 16.04.
@toshihiroryuu
toshihiroryuu / Predicting The Missing Values using Linear Regression
Last active April 29, 2019 11:05
Using the features which do not have missing values, we can predict the nulls with the help of a machine learning algorithm. This method may result in better accuracy, unless a missing value is expected to have a very high variance. We will be using linear regression to replace the nulls in the feature ‘age’, using other available features. One …
from sklear.liner_model import LinerRegression
linreg=LinerRegression()
data_with_null = data[['passengerid', 'class','survived', 'age']].dropna()
data_without_null = data_with_null.dropna()
train_data_x = data_without_null.iolc[:,:4]
train_data_y = data_without_null.iolc[:,4]
@toshihiroryuu
toshihiroryuu / Filling,Removing or processing missing data from tabular dataset
Created April 29, 2019 08:48
Add missing data, Replace missing data , transform missing data, remove rows with missing data using fillna() in pandas library or by using Imputer in sklear.preprocessing.Imputer
import pandas as pd
import numpy as np
df=pd.read_csv("/home/pima_indians_diabetes.csv",header=None)
# # to get a statistical summary of all columns, so that we can identify missing data by checking min value
# print(df.describe())
# print(df.head(20))
from PIL import Image
import matplotlib.pyplot as plt
import numpy as np
def gauss_noise(img):
row,col,ch= img.height, img.width,3
loc = 0
scale=30
@toshihiroryuu
toshihiroryuu / Add_Sub_Mul_values to pixels in each channel seperately
Created April 10, 2019 10:59
Addtion, Substration and Multiplication of values to pixels in each channel seperately
from PIL import Image
import matplotlib.pyplot as plt
class pixel_transformation:
def __init__(self):
self.red_added=0
self.green_added=0
self.blue_added=0
self.red_sub=0
# Parameters
# image : ndarray
# Input image data. Will be converted to float.
# mode : str
# One of the following strings, selecting the type of noise to add:
# 'gauss' Gaussian-distributed additive noise.
# 'poisson' Poisson-distributed noise generated from the data.
# 'saltandpepper' Replaces random pixels with 0 or 1.