Skip to content

Instantly share code, notes, and snippets.

View arthurarty's full-sized avatar

Arthur Nangai arthurarty

View GitHub Profile
@arthurarty
arthurarty / install_nginx.sh
Created April 2, 2019 15:05
Install nginx on linux machine.
#!/bin/bash
#update depencies
sudo apt update && updgrade -y
#install gunicon
sudo apt install nginx -y
@arthurarty
arthurarty / rename_files.py
Last active July 22, 2019 07:04
Rename files in a given directory.
import os
def rename_files(folder_name, new_file_name):
"""Rename images in a folder"""
i = 0
dir = "./" + folder_name
for filename in os.listdir(dir):
dst = new_file_name + str(i) + ".jpg"
src = folder_name + "/" + filename
@arthurarty
arthurarty / Procfile
Created November 18, 2019 13:09
A procfile that includes making migrations.
web: gunicorn vbp.wsgi
release: python manage.py makemigrations --noinput && python manage.py migrate --noinput
@arthurarty
arthurarty / urls.py
Created November 19, 2019 11:55
Django Urls.py file with static files added.
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('authentication.urls')),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
@arthurarty
arthurarty / FEATURE_REQUEST.md
Created February 22, 2020 09:25
Issue template for open source repository
name about title labels assignees
Feature request
Suggest an idea for this project

Is your feature request related to a problem? Please describe.

@arthurarty
arthurarty / CODE_OF_CONDUCT.md
Created February 22, 2020 09:28
Code of conduct for open source repo

Contributor Covenant Code of Conduct

Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

Our Standards

Examples of behavior that contributes to creating a positive environment include:

@arthurarty
arthurarty / CONTRIBUTING.md
Created February 22, 2020 09:30
How to contribute

Contributing

When contributing to this repository, please first discuss the change you wish to make via issue, email, or any other method with the owners of this repository before making a change.

Please note we have a code of conduct, please follow it in all your interactions with the project.

Pull Request Process

  1. Ensure any install or build dependencies are removed before the end of the layer when doing a build.
@arthurarty
arthurarty / PULL_REQUEST_TEMPLATE.md
Last active May 5, 2020 15:46
Pull request templated

Title of Pull Request

<!--- Provide a general summary of your changes in the Title above -->

Description

<!--- Describe your changes in detail -->

Motivation and Context

@arthurarty
arthurarty / format_dict_json.py
Created January 10, 2022 10:46
Given a List contain dicts, script goes through and creates fixture for django.
import json
input_data = [
{
"name": "Afghanistan",
"code": "AF"
},
{
"name": "Åland Islands",
@arthurarty
arthurarty / limit-memory-cpu-wsl.md
Created February 14, 2023 00:12 — forked from xuandinhgl/limit-memory-cpu-wsl.md
WSL2 Tips: Limit CPU/Memory When using Docker

Turn off all wsl instances such as docker-desktop

wsl --shutdown notepad "$env:USERPROFILE/.wslconfig"

Edit .wslconfig file with notepad and write down these settings:

[wsl2]

memory=3GB # Limits VM memory in WSL 2 up to 3GB