Skip to content

Instantly share code, notes, and snippets.

View kiranparajuli589's full-sized avatar
🎸
LalaLaa

Kiran Parajuli kiranparajuli589

🎸
LalaLaa
View GitHub Profile
@kiranparajuli589
kiranparajuli589 / systemd-gunicorn-django.md
Created March 14, 2023 07:49
how to create a systemd command for django server using gunicorn over some port

To create a systemd command for a Django server using Gunicorn to serve the project over some port, follow these steps:

  1. Create a gunicorn configuration file. In your project directory, create a file named gunicorn.py with the following contents:

    bind = "0.0.0.0:8000"
    workers = 4
  2. Install Gunicorn in your project environment if not yet installed.

@kiranparajuli589
kiranparajuli589 / subdomain-proxy-nginx.md
Created March 13, 2023 18:33
Configuration to route a request from domain `sub.xxx.com` to `localhost:8000` in nginx config

To configure Nginx to route a request from a subdomain, sub.xxx.com, to localhost:8000, you can follow these steps:

  1. Open the Nginx configuration file for the domain, usually located at /etc/nginx/sites-available/sub.xxx.com.

  2. Add the following server block to the file:

    server {
        listen 80;
        server_name sub.xxx.com;
    
@kiranparajuli589
kiranparajuli589 / README.md
Last active March 9, 2023 15:10
Example commands to download using `youtube-dl` CLI

YouTube DL

  1. Download the best quality video and audio:
youtube-dl -f bestvideo+bestaudio [video URL]

This will download the best quality video and audio available for the specified video URL.

  1. Download the best quality video and audio as separate files:
@kiranparajuli589
kiranparajuli589 / Makefile
Created December 8, 2022 14:47
Print colorful plus bold with (in) Makefile
FONT_RED := $(shell tput setaf 1)
FONT_GREEN := $(shell tput setaf 2)
FONT_YELLOW := $(shell tput setaf 3)
FONT_BLUE := $(shell tput setaf 4)
FONT_PURPLE := $(shell tput setaf 5)
FONT_CYAN := $(shell tput setaf 6)
FONT_GRAY := $(shell tput setaf 7)
FONT_BLACK := $(shell tput setaf 8)
FONT_BOLD := $(shell tput bold)
FONT_RESET := $(shell tput sgr0)
@kiranparajuli589
kiranparajuli589 / .env
Last active September 30, 2022 05:36
Content of .env file for ocis_ldap docs testing
# If you're on a internet facing server please comment out following line.
# It skips certificate validation for various parts of oCIS and is needed if you use self signed certificates.
INSECURE=false
# The demo users should not be created on a production instance
# because their passwords are public
DEMO_USERS=true
### Traefik settings ###
# Serve Traefik dashboard. Defaults to "false".
@kiranparajuli589
kiranparajuli589 / Dockerfile
Created August 17, 2022 15:41
Minio MC Client with Ubuntu
FROM ubuntu:22.04
RUN apt-get update
RUN apt-get install -y wget
RUN wget https://dl.min.io/client/mc/release/linux-amd64/mc
RUN chmod +x mc
RUN mv mc /usr/local/bin/
ENTRYPOINT [ "mc" ]
@kiranparajuli589
kiranparajuli589 / TextInput.vue
Last active August 4, 2022 12:46
TextInput component for Vue3 (Reactive v-model)
<template>
<div class="form-control">
<label class="label">
<span class="label-text">{{ labelName }}</span>
</label>
<input
type="text"
class="input input-bordered"
:value="tv"
@input="updateModelValue"
@kiranparajuli589
kiranparajuli589 / docker-compose.yml
Created August 3, 2022 11:33
Docker Compose for MariaDB|MySQL with Healthcheck
version: "3.8"
services:
db:
image: mariadb
container_name: mariadb
restart: always
healthcheck:
test: [ "CMD-SHELL", "mysqladmin ping" ]
timeout: 3m
@kiranparajuli589
kiranparajuli589 / response.xml
Last active October 11, 2022 04:50
User capabilites with oc10
❯ curl -v -utu1:tu1 http://localhost/owncloud/core/ocs/v1.php/cloud/capabilities | xmllint --format -
<?xml version="1.0"?>
<ocs>
<meta>
<status>ok</status>
<statuscode>100</statuscode>
<message>OK</message>
<totalitems/>
<itemsperpage/>
@kiranparajuli589
kiranparajuli589 / response.xml
Last active October 11, 2022 04:50
User capabilities response with ocis
❯ curl -kv -ueinstein:relativity https://host.docker.internal:9200/ocs/v1.php/cloud/capabilities | xmllint --format -
<?xml version="1.0" encoding="UTF-8"?>
<ocs>
<meta>
<status>ok</status>
<statuscode>100</statuscode>
<message>OK</message>
</meta>
<data>