Skip to content

Instantly share code, notes, and snippets.

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

Manot Luijiu ManotLuijiu

🏠
Working from home
View GitHub Profile
@ManotLuijiu
ManotLuijiu / lazada.py
Last active July 24, 2024 10:39
Import Purchase Order from Lazada to ERPNext
import local_config as config
import pandas as pd
import numpy as np
import requests
# ERPNext API credentials
# api_url = config.ERPNEXT_URL_15_ERP + "/api/resource/Sales Invoice" or
api_url = "https://your-erpnext-url/api/resource/Sales%20Invoice"
api_key = config.ERPNEXT_API_KEY_ADMIN_15_ERP
api_secret = config.ERPNEXT_API_SECRET_ADMIN_15_ERP
@ManotLuijiu
ManotLuijiu / aws_command.log
Last active July 21, 2024 02:16
AWS CLI Command
aws s3 cp s3://your_bucket_name . --recursive --profile your_profile_name
@ManotLuijiu
ManotLuijiu / docker-compose.yml
Last active June 29, 2024 16:04
How to install Stirling PDF on Docker using docker-compose
version: '3.3'
services:
stirling-pdf:
image: frooodle/s-pdf:latest
ports:
- '8080:8080'
volumes:
- ./trainingData:/usr/share/tessdata #Required for extra OCR languages
- ./extraConfigs:/configs
- ./customFiles:/customFiles/
@ManotLuijiu
ManotLuijiu / ansible.log
Last active June 23, 2024 11:06
ERROR! [DEPRECATED]: ansible.builtin.include has been removed.
ERROR! [DEPRECATED]: ansible.builtin.include has been removed. Use include_tasks or import_tasks instead. This feature was removed from ansible-core in a release after 2023-05-16. Please update your playbooks.
The error appears to be in '/usr/local/lib/python3.10/dist-packages/bench/playbooks/roles/mariadb/tasks/main.yml': line 2, column 3, but may
be elsewhere in the file depending on the exact syntax problem.
The offending line appears to be:
@ManotLuijiu
ManotLuijiu / ImportLazada2ERPNext
Last active June 15, 2024 06:47
Delete Columns in Lazada export file
Sub DeleteColumns()
Dim ws As Worksheet
Dim col As Range
' Set the worksheet you want to work on
Set ws = ThisWorkbook.Sheets("ALL")
' Specify the columns you want to delete
' You can specify columns by their letters or numbers (e.g., "A", "C", "E" or 1, 3, 5)
Dim columnsToDelete As Variant
@ManotLuijiu
ManotLuijiu / Dockerfile
Last active June 13, 2024 05:16
Install Coder's Workspace on Docker. In case you want to use locales, zsh and Oh-My-Zsh together with Coder-Server
FROM ubuntu
#FROM ubuntu:22.04 as base
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get install -y \
curl \
git \
golang \
sudo \
@ManotLuijiu
ManotLuijiu / sst.config.ts
Last active June 6, 2024 02:45
Configuration for new sst version
/// <reference path="./.sst/platform/config.d.ts" />
export default $config({
app(input) {
return {
name: "project-name",
removal: input?.stage === "production" ? "retain" : "remove",
home: "aws",
providers: {
aws: {
@ManotLuijiu
ManotLuijiu / urls.py
Created December 12, 2023 04:46
users -> urls.py
from django.urls import path, re_path
from .views import (
CustomProviderAuthView,
CustomTokenObtainPairView,
CustomTokenRefreshView,
CustomTokenVerifyView,
LogoutView,
)
urlpatterns = [
@ManotLuijiu
ManotLuijiu / views.py
Created December 12, 2023 04:23
users -> views.py
from django.conf import settings
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from djoser.social.views import ProviderAuthView
from rest_framework_simplejwt.views import (
TokenObtainPairView,
TokenRefreshView,
TokenVerifyView,
)
@ManotLuijiu
ManotLuijiu / authentication.py
Created December 12, 2023 03:26
users -> authentication.py
from django.conf import settings
from rest_framework_simplejwt.authentication import JWTAuthentication
class CustomJWTAuthentication(JWTAuthentication):
def authenticate(self, request):
try:
header = self.get_header(request)
if header is None:
raw_token = request.COOKIES.get(settings.AUTH_COOKIE)