Skip to content

Instantly share code, notes, and snippets.

View mirfan899's full-sized avatar
🏠
Working from home

Muhammad Irfan mirfan899

🏠
Working from home
View GitHub Profile
@mirfan899
mirfan899 / ffmpeg.md
Created September 23, 2020 05:48 — forked from protrolium/ffmpeg.md
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

@mirfan899
mirfan899 / RasaNLU.php
Created April 30, 2020 16:35 — forked from mpociot/RasaNLU.php
RasaNLU middleware for BotMan
<?php
namespace App\BotMan\Middleware;
use Mpociot\BotMan\Message;
use Mpociot\BotMan\Http\Curl;
use Mpociot\BotMan\Interfaces\HttpInterface;
use Mpociot\BotMan\Interfaces\DriverInterface;
use Mpociot\BotMan\Interfaces\MiddlewareInterface;
@mirfan899
mirfan899 / gist:488e994055bb9b18f0065641f6fbe060
Created November 21, 2019 11:59 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@mirfan899
mirfan899 / python_3.6.9.sh
Last active September 20, 2019 05:20
Compile Python 3.6.9 from source
#!/usr/bin/env bash
wget https://www.python.org/ftp/python/3.6.9/Python-3.6.9.tgz
tar xzf Python-3.6.9.tgz
cd Pyhton-3.6.9
./configure --enable-optimizations
make -j 2
make altinstall
@mirfan899
mirfan899 / cuda_setup.sh
Last active September 23, 2019 05:27
Install cuda 9 and cudnn 7 directly from nvidia
sudo apt-get purge cuda
sudo apt-get purge libcudnn6
sudo apt-get purge libcudnn6-dev
# resources for nvidia deb package.
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.0.176-1_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7_7.0.5.15-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libcudnn7-dev_7.0.5.15-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl2_2.1.4-1+cuda9.0_amd64.deb
wget http://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1604/x86_64/libnccl-dev_2.1.4-1+cuda9.0_amd64.deb
@mirfan899
mirfan899 / Install NVIDIA Driver and CUDA.md
Created June 27, 2019 09:37 — forked from zhanwenchen/Install NVIDIA Driver and CUDA.md
Install NVIDIA CUDA 9.0 on Ubuntu 16.04.4 LTS
apt-get update && apt-get install -y \
sox \
curl \
libicu-dev \
g++ \
git \
python \
python-dev \
python-setuptools \
@mirfan899
mirfan899 / cuda_installation_on_ubuntu_18.04
Created May 29, 2019 16:31 — forked from Mahedi-61/cuda_11.8_installation_on_Ubuntu_22.04
cuda 9.0 complete installation procedure for ubuntu 18.04 LTS
#!/bin/bash
## This gist contains step by step instructions to install cuda v9.0 and cudnn 7.2 in ubuntu 18.04
### steps ####
# verify the system has a cuda-capable gpu
# download and install the nvidia cuda toolkit and cudnn
# setup environmental variables
# verify the installation
###
@mirfan899
mirfan899 / mlp.py
Last active November 15, 2019 04:14
import codecs
tagged_sentences = codecs.open("../data/data.txt", encoding="utf-8").readlines()
print(tagged_sentences[0])
import ast
import numpy as np
from keras.layers import Dense, InputLayer, Embedding, Activation
from keras.models import Sequential
from keras.optimizers import Adam
# Keras==1.0.6
import numpy as np
from keras.models import Sequential
from keras.layers.recurrent import LSTM
from keras.layers.core import TimeDistributedDense, Activation
from keras.preprocessing.sequence import pad_sequences
from keras.layers.embeddings import Embedding
from sklearn.cross_validation import train_test_split
from sklearn.metrics import confusion_matrix, accuracy_score, precision_recall_fscore_support