Skip to content

Instantly share code, notes, and snippets.

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

mohammad ali alidevhere

🏠
Working from home
View GitHub Profile
@alidevhere
alidevhere / install virtualenv ubuntu 16.04.md
Created September 8, 2021 11:09 — forked from frfahim/install virtualenv ubuntu 16.04.md
How to install virtual environment on ubuntu 16.04

How to install virtualenv:

Install pip first

sudo apt-get install python3-pip

Then install virtualenv using pip3

sudo pip3 install virtualenv 
@alidevhere
alidevhere / Install GO 1.17.md
Last active November 24, 2021 19:50
github.md

Install GO 1.17 from terminal

sudo add-apt-repository ppa:longsleep/golang-backports
sudo apt update
sudo apt install golang-go

@alidevhere
alidevhere / README.md
Created November 29, 2021 21:03 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@alidevhere
alidevhere / process_Ubuntu.md
Last active April 25, 2022 21:54
find and kill a process running on a port

Find and kill process running on a port

sudo apt-get install lsof 
lsof -i:8080
kill $(lsof -t -i:8080) 
@alidevhere
alidevhere / gist:247b4f23ba0c5b887fa25c92196db9d9
Created December 15, 2021 04:31
Connect To University Wifi from Ubuntu 20.04 LTS
Click on the wireless icon located in the upper right task bar.
Select 'eduroam'
In the Security field, select 'WPA & WPA2 Enterprise'
In the Authentication field, select 'Protected EAP (PEAP)'
Leave the Anonymous Identity field blank
The CA certificate field should be set to 'None'
The check box 'No CA certificate is required' should be checked
The PEAP version field should be set to 'Automatic'
The Inner Authentication field should be set to 'MSCHAPV2'
In the Username field, enter your username@rose-hulman.edu
@alidevhere
alidevhere / struct_custom_unmarshal.go
Created May 27, 2022 06:41 — forked from miguelmota/struct_custom_unmarshal.go
Golang custom struct unmarshal function example
package main
import (
"encoding/json"
"fmt"
"log"
"time"
)
type MyStruct struct {
@alidevhere
alidevhere / reset_Django_Migrations.md
Last active May 28, 2022 10:51
Reset Django Database migrations

Reset Django Migrations

1-Delete Schemma 2- find . -path "/migrations/.py" -not -name "init.py" -delete 3- find . -path "/migrations/.pyc" -delete 4- python manage.py makemigrations 5- python manage.py migrate

@alidevhere
alidevhere / ft2build_sol.md
Created August 3, 2022 06:23
setup-python-3.8.13-linux-x86_64: will use package libart 2.3.21 cannot find ft2build.h

This error occurs when trying to install reportlab on alpine image in docker:

Alpine image has some missing dependencies for reportlab, add following command too before installing reportlab

apk add python3-dev freetype-dev

Append to file in go

f, err := os.OpenFile("text.log",
	os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
if err != nil {
	log.Println(err)
}
defer f.Close()
if _, err := f.WriteString("text to append\n"); err != nil {
	log.Println(err)

Run Azure Power shell commands from Linux - Ultimate Guide:

Install Powershell on linux

# Update the list of packages
sudo apt-get update

# Install pre-requisite packages.
sudo apt-get install -y wget apt-transport-https software-properties-common