Autor Diego Elcain

Como reinstalar Microsoft Store, Windows Store

Encontrei nesse site https://www.minitool.com/news/how-to-reinstall-microsoft-store.html o melhor tutorial para reinstalar o Microsoft Store ou Windows Store.

O procedimento que deu certo comigo foi:

  1. 1. Go to https://store.rg-adguard.net/.

    2. Copy and paste the following URL to the URL text box: https://www.microsoft.com/en-us/p/microsoft-store/9wzdncrfjbmp.

    3. Select Retail.

    4. Click the Generate icon.

Faça o Download

  • WindowsStore_12011.1001.113.0_neutral_~_8wekyb3d8bbwe.appxbundle

Se tiver mais de um WindowStore ….. appxbundle faça o download de todos.

Abra o Power Shell como administrador

Tente instalar todos os appxbundle baixados.

Add-AppxPackage -Path "C:\Path\to\File.appxbundle"

 

Criando um executável de um projeto em Python com PyInstaller

Dica rápida para criar um executável em python com PyInstaller

1 – Instalar o PyInstaller

pip install pyinstaller

2 – Assim que tiver finalizado o projeto, gere o executável, nesse caso os paramentros são:

2.1 -F – Empacotar tudo em um único arquivo executável.

2.2 – –noconsole – Aplicação irá rodar em background.

pyinstaller.exe -F --noconsole .\main.py

 

[RESOLVIDO] Squid não acessa Whatsapp Web erro de WWS Websocket

Resolvi o problema de erro de websocket no whtasapp web usando o Swquid com SSL BUMP

acl serverIsws ssl::server_name_regex ^w[0-9]+\.web\.whatsapp\.com$ ^w[0-9]+\.web\.whatsapp\.net$
acl broken_sites ssl::server_name .whatsapp.com
acl step1 at_step SslBump1

ssl_bump peek step1
ssl_bump splice serverIsws
ssl_bump splice broken_sites
ssl_bump bump all

 

Typebot Saudação por Períodos do dia.

Segue um template para saudação baseado em períodos do dia.

Salvar arquivo como json e importar no Typebot.

  • Amanhã
  • Tarde
  • Noite
  • Madrugada
{
    "version": "5",
    "id": "clnr7unnr0001qi1p151cyf0k",
    "name": "Saudação",
    "groups": [
        {
            "id": "gil4ln85tcyfr5n5p3utqbvd",
            "title": "Start",
            "graphCoordinates": {
                "x": -22,
                "y": 208
            },
            "blocks": [
                {
                    "id": "f1hwzp3exgim7i8j04re4s4l",
                    "groupId": "gil4ln85tcyfr5n5p3utqbvd",
                    "outgoingEdgeId": "i2zi8k5z6awaiwuuepsfnu4g",
                    "type": "start",
                    "label": "Start"
                }
            ]
        },
        {
            "id": "c1saf3c4himwxy8lnh1v49y1",
            "title": "Script",
            "graphCoordinates": {
                "x": 371,
                "y": 100
            },
            "blocks": [
                {
                    "id": "zvnvff3rmbsh8b3wyb372dzh",
                    "groupId": "c1saf3c4himwxy8lnh1v49y1",
                    "outgoingEdgeId": "ft18i9oqkp6pusm8vsk7r9qs",
                    "type": "Set variable",
                    "options": {
                        "variableId": "vp8od10kng0salkymug9wufam",
                        "expressionToEvaluate": "// Obter a data atual como objeto Date\nlet dataAtual = new Date();\n\n// Configurar o fuso horário\ndataAtual = new Date(dataAtual.toLocaleString('en-US', { timeZone: 'America/Recife' }));\n\n// Obter o horário atual\nlet horaAtual = dataAtual.getHours();\n\n// Determinar a saudação adequada baseada na hora do dia\nlet saudacao;\nif (horaAtual >= 5 && horaAtual < 12) {\n    saudacao = \"Bom dia\";\n} else if (horaAtual >= 12 && horaAtual < 18) {\n    saudacao = \"Boa tarde\";\n} else if (horaAtual >= 18 && horaAtual <= 23) {\n    saudacao = \"Boa noite\";\n} else {\n    saudacao = \"Boa madrugada\";\n}\n\n// Exibir a saudação\nreturn saudacao",
                        "isExecutedOnClient": true
                    }
                }
            ]
        },
        {
            "id": "ycv3zgly0spaovtsckykcom9",
            "title": "Fluxo",
            "graphCoordinates": {
                "x": 762,
                "y": 192
            },
            "blocks": [
                {
                    "id": "fo02bybce2ca3uwwxl9t1i15",
                    "groupId": "ycv3zgly0spaovtsckykcom9",
                    "type": "text",
                    "content": {
                        "richText": [
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "{{saudacao}}"
                                    }
                                ]
                            }
                        ]
                    }
                },
                {
                    "id": "y0l7indhnw5y5wjrvwfmxr7e",
                    "groupId": "ycv3zgly0spaovtsckykcom9",
                    "type": "text",
                    "content": {
                        "richText": [
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "Esculte uma boa música"
                                    }
                                ]
                            }
                        ]
                    }
                },
                {
                    "id": "fa7rjjdp8etlczt75nt92byw",
                    "groupId": "ycv3zgly0spaovtsckykcom9",
                    "type": "text",
                    "content": {
                        "richText": [
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "╔════════════════╗"
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "┃ ▁▂▃▅▆▇ 100%           |"
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "╚════════════════╝"
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "SONG: 𝙱𝚕𝖺𝚌𝚔𝚂𝚝𝗈𝚛𝚖𝚂𝚝𝚍.𝚁𝚎𝚖𝚒𝚡 𝟼𝙼♫"
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "CREATOR: 𝙱𝚕𝚊𝚌𝚔𝚂𝚝𝚘𝚛𝚖 𝚂𝚝𝚞𝚍𝚒𝚘𝚜™®"
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "0:35 ━❍──────── -5:25"
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "↻     ⊲  Ⅱ  ⊳     ↺"
                                    }
                                ]
                            }
                        ]
                    }
                }
            ]
        }
    ],
    "edges": [
        {
            "id": "i2zi8k5z6awaiwuuepsfnu4g",
            "from": {
                "groupId": "gil4ln85tcyfr5n5p3utqbvd",
                "blockId": "f1hwzp3exgim7i8j04re4s4l"
            },
            "to": {
                "groupId": "c1saf3c4himwxy8lnh1v49y1"
            }
        },
        {
            "id": "ft18i9oqkp6pusm8vsk7r9qs",
            "from": {
                "groupId": "c1saf3c4himwxy8lnh1v49y1",
                "blockId": "zvnvff3rmbsh8b3wyb372dzh"
            },
            "to": {
                "groupId": "ycv3zgly0spaovtsckykcom9"
            }
        }
    ],
    "variables": [
        {
            "id": "vz86mn60nk870kdefhbvrov3r",
            "name": "data"
        },
        {
            "id": "vp8od10kng0salkymug9wufam",
            "name": "saudacao"
        }
    ],
    "theme": {
        "general": {
            "font": "Open Sans",
            "background": {
                "type": "Color",
                "content": "#ffffff"
            }
        },
        "chat": {
            "hostAvatar": {
                "isEnabled": true
            },
            "hostBubbles": {
                "backgroundColor": "#F7F8FF",
                "color": "#303235"
            },
            "guestBubbles": {
                "backgroundColor": "#FF8E21",
                "color": "#FFFFFF"
            },
            "buttons": {
                "backgroundColor": "#0042DA",
                "color": "#FFFFFF"
            },
            "inputs": {
                "backgroundColor": "#FFFFFF",
                "color": "#303235",
                "placeholderColor": "#9095A0"
            }
        }
    },
    "selectedThemeTemplateId": null,
    "settings": {
        "general": {
            "isBrandingEnabled": false,
            "isInputPrefillEnabled": true,
            "isHideQueryParamsEnabled": true,
            "rememberUser": {
                "isEnabled": false
            }
        },
        "typingEmulation": {
            "enabled": true,
            "speed": 300,
            "maxDelay": 1.5
        },
        "metadata": {
            "description": "Build beautiful conversational forms and embed them directly in your applications without a line of code. Triple your response rate and collect answers that has more value compared to a traditional form."
        }
    },
    "createdAt": "2023-10-15T08:40:14.151Z",
    "updatedAt": "2023-10-15T22:24:28.641Z",
    "icon": null,
    "folderId": null,
    "publicId": "saudacao",
    "customDomain": null,
    "workspaceId": "clnr64nj00001n21oaw5nat15",
    "resultsTablePreferences": null,
    "isArchived": false,
    "isClosed": false,
    "whatsAppCredentialsId": null
}

 

Template tipo Whatsapp para Typebot

Segue template para Typebot com layout parecido com whatsapp, necessário ler o código e fazer as devidas modificações.

 

{
    "version": "6",
    "id": "clzlarpa0000bztu5ay02hwvv",
    "chatwootId": 243,
    "chatwootAccessToken": "V97YZLpojGRB4vF9mdvnYsvK",
    "name": "Tema Whatsapp",
    "events": [
        {
            "id": "yrr8y4zobeuilc4hgi0upv4m",
            "outgoingEdgeId": "hadici5c9y7j268r2dmr13re",
            "graphCoordinates": {
                "x": 0,
                "y": 0
            },
            "type": "start"
        }
    ],
    "groups": [
        {
            "id": "ryb27uv1cjy7zwx62nasim8q",
            "title": "Pack Typebot",
            "graphCoordinates": {
                "x": 398,
                "y": -6.56
            },
            "blocks": [
                {
                    "id": "okkwzkr1qifomzx7cvwrt56z",
                    "type": "text",
                    "content": {
                        "richText": [
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "Informe seu nome"
                                    }
                                ]
                            }
                        ]
                    }
                },
                {
                    "id": "u3iqumupccy94li0p8jvr2t8",
                    "type": "text input",
                    "options": {
                        "labels": {
                            "placeholder": "Informe seu nome aqui!",
                            "button": "Enviar"
                        },
                        "variableId": "vxdnn35rtjib49ifx1aglqf3p",
                        "isLong": false
                    }
                },
                {
                    "id": "t16ejdpe2y5cwlrm6iu1a5oq",
                    "type": "text",
                    "content": {
                        "richText": [
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "bold": true,
                                        "text": "{{nome}} "
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "Bem-vindo ao Mundo da Automação! 🤖"
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": ""
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "🛒 Não perca tempo! Seja membro do Pack Typebot agora mesmo!"
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": ""
                                    }
                                ]
                            },
                            {
                                "type": "p",
                                "children": [
                                    {
                                        "text": "Aproveite o valor promocional para acesso vitalício!"
                                    }
                                ]
                            }
                        ]
                    }
                },
                {
                    "id": "rzbihfketjlxwltnjww6fkhk",
                    "type": "choice input",
                    "items": [
                        {
                            "id": "b979obnqc2y3eta7teyg74jx",
                            "outgoingEdgeId": "sz4uc36p74lsks0o525k2cp1",
                            "content": "Saiba Mais"
                        }
                    ],
                    "options": {
                        "isMultipleChoice": false,
                        "buttonLabel": "Send",
                        "isSearchable": false,
                        "searchInputPlaceholder": "Filter the options..."
                    }
                },
                {
                    "id": "z396idrici2orpcyt3gluw07",
                    "type": "Redirect",
                    "options": {
                        "url": "#",
                        "isNewTab": false
                    }
                }
            ]
        }
    ],
    "edges": [
        {
            "id": "hadici5c9y7j268r2dmr13re",
            "from": {
                "eventId": "yrr8y4zobeuilc4hgi0upv4m"
            },
            "to": {
                "groupId": "ryb27uv1cjy7zwx62nasim8q"
            }
        },
        {
            "id": "sz4uc36p74lsks0o525k2cp1",
            "from": {
                "blockId": "rzbihfketjlxwltnjww6fkhk",
                "itemId": "b979obnqc2y3eta7teyg74jx"
            },
            "to": {
                "groupId": "ryb27uv1cjy7zwx62nasim8q",
                "blockId": "z396idrici2orpcyt3gluw07"
            }
        }
    ],
    "variables": [
        {
            "id": "vxdnn35rtjib49ifx1aglqf3p",
            "name": "nome"
        },
        {
            "id": "ex5nfm5aqh6z7qtsifs01pcr",
            "name": "inbox_id"
        },
        {
            "id": "zsipq68dkr7007y5316wrhm5",
            "name": "inbox_channel_identifier"
        },
        {
            "id": "rr8t2ydnlhu4lgjs3n167j48",
            "name": "inbox_whatsapp_bridge_host"
        },
        {
            "id": "pwhegm84n7sqg8nki868khbc",
            "name": "inbox_whatsapp_bridge_url"
        },
        {
            "id": "s9insldi07g622tikoiriuqq",
            "name": "account_id"
        },
        {
            "id": "borm113pquxemusae1z7ghrs",
            "name": "conversation_id"
        },
        {
            "id": "vbphydm38osficzhmu8u4vg7",
            "name": "display_id"
        },
        {
            "id": "ytg1bfwgqwpmsk1ehhah7gjz",
            "name": "bot_id"
        },
        {
            "id": "qnb32u8ipdnrw1qnhepzftd0",
            "name": "bot_name"
        },
        {
            "id": "zuwbkkeies7ot38sysgto9zg",
            "name": "contact_id"
        },
        {
            "id": "pxr1sgowty7kjm99g7ny0leo",
            "name": "contact_name"
        },
        {
            "id": "dxu320dr7akybxwvdimtie19",
            "name": "contact_email"
        },
        {
            "id": "asd48diu3mfy4ds7spis8lga",
            "name": "contact_phone_number"
        }
    ],
    "theme": {
        "general": {
            "font": "Open Sans",
            "background": {
                "type": "Image",
                "content": "https://s3.typebot.io/public/workspaces/clxgpan6q000rljk8iyy6q66x/typebots/clxgpawpm000p10ew33m2mf3l/blocks/hw249uzjqo07tp4g5q6f9rox?v=1718491741261"
            }
        },
        "chat": {
            "hostAvatar": {
                "isEnabled": true,
                "url": "https://s3.fr-par.scw.cloud/typebot/public/typebots/clk9pyihe003pm90fzfem5k5w/ogImage?v=1689823389465"
            },
            "hostBubbles": {
                "backgroundColor": "#FFFFFF",
                "color": "#303235"
            },
            "guestBubbles": {
                "backgroundColor": "#d9fdd2",
                "color": "#000000"
            },
            "buttons": {
                "backgroundColor": "#128c7e",
                "color": "#FFFFFF"
            },
            "inputs": {
                "backgroundColor": "#FFFFFF",
                "color": "#303235",
                "placeholderColor": "#9095A0"
            }
        },
        "customCss": ".typebot-host-bubble {\n  padding-right: 12px;\n}\n#checkIcon {\n  stroke-dasharray: 40;\n  stroke-dashoffset: 40;\n  z-index: 99;\n}\n#checkIcon path:nth-child(1) {  \n  animation: showIcon 250ms ease forwards;\n  animation-delay: 500ms;\n}\n#checkIcon path:nth-child(2) {  \n  animation: showIcon 250ms ease forwards;\n  animation-delay: 400ms;\n}\n@keyframes showIcon {\n  to { stroke-dashoffset: 0 };\n}\n.typebot-chat-view > .flex:first-child {\n    padding-top: 30px;\n}\n.typebot-input {\n    position: fixed;\n    bottom: 0;\n    align-items: center;\n    z-index: 999;\n    right: 0;\n}\n.typebot-input .typebot-button {\n    background: #008a7c;\n    border-radius: 50%;\n    color: #fff;\n    position: relative;\n    width: 50px;\n    height: 50px;\n    display: flex;\n    align-items: center;\n    justify-content: center;\n}\n.typebot-container {\n    background-size: initial!important;\n    background-repeat: repeat-x!important;\n}\n.typebot-host-bubble>.bubble-typing {\n  border-radius: 0 5px 5px 5px;\n}\n.typebot-host-bubble>.bubble-typing:after {\n    position: absolute;\n    content: \"\";\n    width: 0;\n    height: 0;\n    border-style: solid;\n    border-width: 0px 10px 10px 0;\n    border-color: transparent #fff transparent transparent;\n    top: 0;\n    left: -10px;\n}\n.typebot-guest-bubble {\n  position: relative;\n  border-radius: 5px 0 5px 5px;\n}\n.typebot-guest-bubble:after {\n  position: absolute;\n  content: \"\";\n  width: 0;\n  height: 0;\n  border-style: solid;\n}\n.typebot-guest-bubble:after {\n    border-width: 0px 0 10px 10px;\n    border-color: transparent transparent transparent #D9FDD2;\n    top: 0;\n    right: -10px;\n    border-style: solid;\n}\niframe[src=\"\"] {\n  position: fixed;\n  top: 0;\n  left: 0;\n  display: relative;\n  width: 100%;\n  height: 100% !important;\n  z-index: 999999;\n  border: none;\n  padding: 0;\n  margin: 0;\n}\n.info-container {\nfont-size: 14px;\n}\n.typebot-input .typebot-button {\n  content: \"\";\n  background: rgba(0, 138, 134, 1);\n  border-radius: 50%; \n  position: relative;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  width: 50px; \n  height: 50px; \n  border: none;\n  font-size: 0px;\n  color: transparent;\n}\n.typebot-input .typebot-button::before {\n  content: \"\";\n  position: absolute;\n  top: 50%;\n  transform: translateY(-50%);\n  width: 25px;\n  height: 25px;\n  background-repeat: no-repeat;\n  background-size: cover;\n  background-image: url('data:image/svg+xml;charset=utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" width=\"19px\"><path d=\"M476.59 227.05l-.16-.07L49.35 49.84A23.56 23.56 0 0027.14 52 24.65 24.65 0 0016 72.59v113.29a24 24 0 0019.52 23.57l232.93 43.07a4 4 0 010 7.86L35.53 303.45A24 24 0 0016 327v113.31A23.57 23.57 0 0026.59 460a23.94 23.94 0 0013.22 4 24.55 24.55 0 009.52-1.93L476.4 285.94l.19-.09a32 32 0 000-58.8z\" fill=\"white\"/></svg>');\n}\n.typebot-input .typebot-button .send-icon {\n  display: none; \n}\n.typebot-input {\n    max-width: 100%!important;\n    width:100%!important;\n    position: fixed;\n    bottom: 50px;\n    align-items: center;\n    z-index: 999;\n    right: 0;\n    margin-bottom: 20px;\n    background-color: white;\n    border-radius: 50px;\n    box-shadow: 1 2px 1px -1px rgba(0,0,0,.2);\n    height: 50px;\n    padding-right: 0px!important;\n}\n.disabled\\:opacity-50:disabled {\n    opacity: 100%;\n}\n@media (max-width: 500px) {\n.info-container {\nmax-width: 400px !important;\n}\n}\na#lite-badge {\n  display: none!important;\n}"
    },
    "selectedThemeTemplateId": null,
    "settings": {
        "general": {
            "isBrandingEnabled": false,
            "isInputPrefillEnabled": true,
            "isHideQueryParamsEnabled": true,
            "rememberUser": {
                "isEnabled": false
            }
        },
        "typingEmulation": {
            "enabled": true,
            "speed": 300,
            "maxDelay": 1.5
        },
        "metadata": {
            "title": "(1) WhatsApp",
            "description": "",
            "imageUrl": "https://s3.typebot.io/public/workspaces/clxgpan6q000rljk8iyy6q66x/typebots/clxgpawpm000p10ew33m2mf3l/blocks/s18qxz52lu4cfedpbuhmbch8?v=1718491503856",
            "favIconUrl": "https://s3.typebot.io/public/workspaces/clxgpan6q000rljk8iyy6q66x/typebots/clxgpawpm000p10ew33m2mf3l/blocks/ppd1nlwo6woy0e8z6frmr62i?v=1718491461881",
            "customHeadCode": "<link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/material-design-iconic-font/2.2.0/css/material-design-iconic-font.min.css\">\n<style>\n  .hide {\n    display: none!important;\n  }\n  typebot-standard {\n    position: relative;\n    z-index: 9999;\n  }\n  #__next {\n    position: relative;\n    z-index: 9999;\n}\n.user-bar {\n  width: 100%;\n  height: 55px;\n  background: #005e54;\n  color: #fff;\n  padding: 0;\n  font-size: 24px;\n  position: fixed;\n  z-index: 99999;\n  display: block;\n  top: 0;\n}\n.user-bar:after {\n  content: \"\";\n  display: table;\n  clear: both;\n}\n.user-bar div {\n    float: left;\n    transform: translateY(-50%);\n    position: relative;\n    top: 50%;\n    margin-left: 10px;\n}\n.user-bar .actions {\n  float: right;\n  margin: 0 0 0 20px;\n}\n.user-bar .actions.more {\n  margin: 0 12px 0 32px;\n}\n.user-bar .actions.attachment {\n  margin: 0 0 0 30px;\n}\n.user-bar .actions.attachment i {\n  display: block;\n  transform: rotate(-45deg);\n}\n.user-bar .avatar {\n  margin: 0 0 0 5px;\n  width: 36px;\n  height: 36px;\n}\n.user-bar .avatar img {\n  border-radius: 50%;\n  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1);\n  display: block;\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n}\n.user-bar .name {\n  font-size: 17px;\n  font-weight: 600;\n  text-overflow: ellipsis;\n  letter-spacing: 0.3px;\n  margin: 0 0 0 8px;\n  overflow: hidden;\n  white-space: nowrap;\n  width: 150px;\n}\n.user-bar .status {\n  display: block;\n  font-size: 13px;\n  font-weight: 400;\n  letter-spacing: 0;\n}\n.typebot-input .typebot-button {\n  content: \"\";\n  background: rgba(0, 138, 134, 1);\n  border-radius: 50%; \n  position: relative;\n  display: flex;\n  align-items: center;\n  justify-content: center;\n  width: 50px; \n  height: 50px; \n  border: none;\n  font-size: 0px;\n  color: transparent;\n}\n.typebot-input .typebot-button::before {\n  content: \"\";\n  position: absolute;\n  top: 50%;\n  transform: translateY(-50%);\n  width: 25px;\n  height: 25px;\n  background-repeat: no-repeat;\n  background-size: cover;\n  background-image: url('data:image/svg+xml;charset=utf8,<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 512 512\" width=\"19px\"><path d=\"M476.59 227.05l-.16-.07L49.35 49.84A23.56 23.56 0 0027.14 52 24.65 24.65 0 0016 72.59v113.29a24 24 0 0019.52 23.57l232.93 43.07a4 4 0 010 7.86L35.53 303.45A24 24 0 0016 327v113.31A23.57 23.57 0 0026.59 460a23.94 23.94 0 0013.22 4 24.55 24.55 0 009.52-1.93L476.4 285.94l.19-.09a32 32 0 000-58.8z\" fill=\"white\"/></svg>');\n}\n.typebot-input .typebot-button .send-icon {\n  display: none; \n}\n.typebot-input {\n    max-width: 100%!important;\n    width:100%!important;\n    position: fixed;\n    bottom: 0;\n    align-items: center;\n    z-index: 999;\n    right: 0;\n    margin-bottom: 20px;\n    background-color: white;\n    border-radius: 50px;\n    box-shadow: 1 2px 1px -1px rgba(0,0,0,.2);\n    height: 50px;\n    padding-right: 0px!important;\n}\n.disabled\\:opacity-50:disabled {\n    opacity: 100%;\n}\n</style>\n<script>\nfunction criarBarra() {\n  var userBar = document.createElement(\"div\");\n  userBar.className = \"user-bar\";\n  var icone_botao_voltar = document.createElement(\"div\");\n  icone_botao_voltar.className = \"back\";\n  icone_botao_voltar.innerHTML = '<i class=\"zmdi zmdi-arrow-left\"></i>';\n  var avatar = document.createElement(\"div\");\n  avatar.className = \"avatar\";\n  avatar.innerHTML = '<img src=\"https://s3.fr-par.scw.cloud/typebot/public/typebots/clk9pyihe003pm90fzfem5k5w/ogImage?v=1689823389465\" alt=\"Avatar\">';\n  var name = document.createElement(\"div\");\n  name.className = \"name\";\n  name.innerHTML = '<span>Carteira de Couro</span> <span data-testid=\"psa-verified\" data-icon=\"psa-verified\" class=\"\"><svg viewBox=\"0 0 18 18\" height=\"18\" width=\"18\" preserveAspectRatio=\"xMidYMid meet\" class=\"\" version=\"1.1\" x=\"0px\" y=\"0px\" enable-background=\"new 0 0 18 18\" xml:space=\"preserve\"><polygon id=\"Star-2\" fill=\"#00DA60\" points=\"9,16 7.1,16.9 5.8,15.2 3.7,15.1 3.4,13 1.5,12 2.2,9.9 1.1,8.2 2.6,6.7 2.4,4.6 4.5,4 5.3,2 7.4,2.4 9,1.1 10.7,2.4 12.7,2 13.6,4 15.6,4.6 15.5,6.7 17,8.2 15.9,9.9 16.5,12 14.7,13 14.3,15.1 12.2,15.2 10.9,16.9 \"></polygon><polygon id=\"Check-Icon\" fill=\"#FFFFFF\" points=\"13.1,7.3 12.2,6.5 8.1,10.6 5.9,8.5 5,9.4 8,12.4 \"></polygon></svg></span><span class=\"status\">Online</span>';\n  var icone_camera = document.createElement(\"div\");\n  icone_camera.className = \"actions\";\n  icone_camera.style.float = \"right\";\n  icone_camera.innerHTML = '<i class=\"zmdi zmdi-videocam\" style=\"background-color: transparent;\"></i>';\n  var icone_telefone = document.createElement(\"div\");\n  icone_telefone.className = \"actions\";\n  icone_telefone.style.float = \"right\";\n  icone_telefone.innerHTML = '<i class=\"zmdi zmdi-phone\" style=\"background-color: transparent;\"></i>';\n  var icone_mais = document.createElement(\"div\");\n  icone_mais.className = \"actions more\";\n  icone_mais.style.float = \"right\";\n  icone_mais.innerHTML = '<i class=\"zmdi zmdi-more-vert\" style=\"background-color: transparent;\"></i>';\n  userBar.appendChild(icone_botao_voltar);\n  userBar.appendChild(avatar);\n  userBar.appendChild(name);\n  userBar.appendChild(icone_mais);\n  userBar.appendChild(icone_telefone);\n  userBar.appendChild(icone_camera);\n  var elementoPai = document.querySelector(\"#__next\");\n  if (elementoPai) {\n    elementoPai.insertBefore(userBar, elementoPai.firstChild);\n  }\n}\ncriarBarra();\n</script>\n<script>\n  const botBody = document.querySelector('typebot-standard')\n        .shadowRoot.querySelector('.typebot-container');\n  const userAvatar = botBody.querySelector('img[elementtiming=\"Bot avatar\"]');\n  const status = document.querySelector('.status');\n  const audioNot = document.createElement('audio');\n  audioNot.src = 'https://s3.typebot.io/public/workspaces/clxgpan6q000rljk8iyy6q66x/typebots/clxgpawpm000p10ew33m2mf3l/blocks/o6lzakgjf9az8tg6tyfk29lf?v=1718491238886';\n  let mensagesLength = 0;\n  createInfoMessage();\n  function createInfoMessage() {\n    const message= \"Esta é uma conta comercial\";\n    const div = document.createElement('div');\n    const infoHTML = `<div style=\"display: flex; align-items: center; gap: 4px; background-color: #d5f4f0; border-radius: 10px; padding: 10px; width: fit-content; max-width: 450px; margin: 2rem auto .5rem;\" class=\"info-container\">\n      <div>\n        <svg width=\"24px\" height=\"24px\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n          <path fill=\"#4b5e63\" fill-rule=\"evenodd\" clip-rule=\"evenodd\" d=\"M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM12 17.75C12.4142 17.75 12.75 17.4142 12.75 17V11C12.75 10.5858 12.4142 10.25 12 10.25C11.5858 10.25 11.25 10.5858 11.25 11V17C11.25 17.4142 11.5858 17.75 12 17.75ZM12 7C12.5523 7 13 7.44772 13 8C13 8.55228 12.5523 9 12 9C11.4477 9 11 8.55228 11 8C11 7.44772 11.4477 7 12 7Z\"></path>\n        </svg>\n      </div>\n      <p style=\"color: #53676b;\">${message}</p>\n    </div>`;\n    div.innerHTML = infoHTML;\n    const messagesContainer = botBody.querySelector('.typebot-chat-view');\n    messagesContainer.insertBefore(div, messagesContainer.firstChild);\n  }\n  setInterval(() => {\n      const isTyping = botBody.querySelector('.bubble1');\n      const sibling = isTyping?.parentElement?.parentElement?.nextSibling;\n      if(isTyping && sibling.src) {\n        status.innerText = 'gravando audio...'\n      } else if(isTyping) {      \n        status.innerText = 'digitando...'\n      } else {\n        status.innerText = 'Online'\n      }\n      const allMessages = botBody.querySelector('.typebot-chat-view').querySelectorAll('.items-start.typebot-host-bubble');    \n      if(allMessages.length > mensagesLength) {        \n        if(!isTyping) {\n          for (let i = mensagesLength; i < allMessages.length; i++) {\n            const iconContainer = document.createElement('div');\n            const checkIcon = `<svg id=\"checkIcon\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 38.626 24.684\" style=\"position: absolute;bottom: 0;right: 5px;\" height=\"20\" width=\"18\">\n              <g id=\"Grupo_1\" data-name=\"Grupo 1\" transform=\"translate(-708.9 -601.383)\">\n                <path id=\"Caminho_6\" data-name=\"Caminho 6\" d=\"M728.035,623.468l1.382,1.482,17.929-20.334\" transform=\"translate(-1.937 -1.117)\" fill=\"none\" stroke=\"#07c654\" stroke-linecap=\"round\" stroke-width=\"3\"></path>\n                <path id=\"Caminho_7\" data-name=\"Caminho 7\" d=\"M712.017,616.07l7.088,8.039,17.757-20.14\" transform=\"translate(-1 -0.469)\" fill=\"none\" stroke=\"#07c654\" stroke-linecap=\"round\" stroke-width=\"3\"></path>\n              </g>\n            </svg>`;\n            iconContainer.innerHTML = checkIcon;\n            const currentMsg = allMessages[i];\n            currentMsg.append(iconContainer);\n          }\n          mensagesLength = allMessages.length;\n          audioNot.play();        \n        }\n      }\n    }, 400)\n</script>"
        }
    },
    "createdAt": "2024-08-08T13:11:46.104Z",
    "updatedAt": "2024-09-09T14:45:00.579Z",
    "icon": "https://s3.typebot.io/public/workspaces/clxgpan6q000rljk8iyy6q66x/typebots/clxgpawpm000p10ew33m2mf3l/blocks/ppd1nlwo6woy0e8z6frmr62i?v=1718491461881",
    "folderId": "clw6tzec4001pj8vkcl6fe2f9",
    "publicId": null,
    "customDomain": null,
    "workspaceId": "1",
    "resultsTablePreferences": null,
    "isArchived": false,
    "isClosed": false,
    "whatsAppCredentialsId": null,
    "riskLevel": null
}

 

osTicket Nginx With API Works

Segue a configurção do nginx para osTicket rodando com nginx.

Obs. Importante, confirme a versão do php-fpm e diretório onde encontra-se o .sock, pode ser necessário atualizar da acordo com a sua instalação.

server {
    server_name suporte.xyz.com.br;
    root /var/www/html/osticket;
    index index.php index.html index.htm;

    access_log /var/log/nginx/osticket_access.log;
    error_log /var/log/nginx/osticket_error.log;

    client_max_body_size 2000M;
    client_body_buffer_size 100M;
    client_header_buffer_size 10M;
    large_client_header_buffers 2 10M;
    client_body_timeout 12;
    client_header_timeout 12;
    keepalive_timeout 15;
    send_timeout 10;
    gzip on;
    gzip_comp_level 2;
    gzip_min_length 1000;
    gzip_proxied expired no-cache no-store private auth;
    gzip_types text/plain application/x-javascript text/xml text/css application/xml;

    set $path_info "";

    location ~ /include {
        deny all;
        return 403;
    }

    if ($request_uri ~ "^/api(/[^\?]+)") {
        set $path_info $1;
    }

    location ~ ^/api/(?:tickets|tasks).*$ {
        try_files $uri $uri/ /api/http.php?$query_string;
    }

    if ($request_uri ~ "^/scp/.*\.php(/[^\?]+)") {
        set $path_info $1;
    }

    location ~ ^/scp/ajax.php/.*$ {
        try_files $uri $uri/ /scp/ajax.php?$query_string;
    }

    location / {
        try_files $uri $uri/ index.php;
    }

    location ~ \.php$ {
        fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
        include        fastcgi_params;
        fastcgi_pass unix:/run/php/php8.3-fpm.sock;
        fastcgi_param  PATH_INFO    $path_info;
    }

    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/suporte.xyz.com.br/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/suporte.xyz.com.br/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}


server {
    if ($host = suporte.zyz.com.br) {
    return 301 https://$host$request_uri;
    } # managed by Certbot

    server_name suporte.zyz.com.br;
        listen 80;
    return 404; # managed by Certbot
}

 

Proxmox – Como anexar um disco físico dentro da VM convidada

Nessa dica rápida iremos aprender como anexar um disco físico do seu servidor proxmox dentro de um maquina virtual.

Essa dica também é conhecida Como fazer Passthrough de HD.

 

1ª Passo – Listar os HD’s fisicamente para isso utilize os comando lsblk

proxmox01:~# lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
sda      8:0    0 447,1G  0 disk
├─sda1   8:1    0 446,2G  0 part /
├─sda2   8:2    0     1K  0 part
└─sda5   8:5    0   976M  0 part [SWAP]
sdb      8:16   0 931,5G  0 disk
├─sdb1   8:17   0   300M  0 part
├─sdb2   8:18   0   100M  0 part
├─sdb3   8:19   0   128M  0 part
├─sdb4   8:20   0   146G  0 part
└─sdb5   8:21   0   785G  0 part
sdc      8:32   0 931,5G  0 disk
├─sdc1   8:33   0   300M  0 part
├─sdc2   8:34   0   100M  0 part
├─sdc3   8:35   0   128M  0 part
├─sdc4   8:36   0   146G  0 part
└─sdc5   8:37   0   785G  0 part
sdd      8:48   0   1,8T  0 disk
├─sdd1   8:49   0   128M  0 part
└─sdd2   8:50   0   1,8T  0 part
sr0     11:0    1  1024M  0 rom

2ª Passo – Identificar os HD’s fisicamente para isso utilize os comando ls -lha /dev/disk/by-id

ls -lha /dev/disk/by-id/
total 0
drwxr-xr-x 2 root root 820 out 14 13:18 .
drwxr-xr-x 9 root root 180 out 14 13:18 ..
lrwxrwxrwx 1 root root   9 out 11 09:48 ata-hp_DVDRAM_GUB0N_KMGF58F2532 -> ../../sr0
lrwxrwxrwx 1 root root   9 out 11 09:48 ata-KINGSTON_SEDC600M480G_50026B7686B8050C -> ../../sda
lrwxrwxrwx 1 root root  10 out 11 09:48 ata-KINGSTON_SEDC600M480G_50026B7686B8050C-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 out 11 09:48 ata-KINGSTON_SEDC600M480G_50026B7686B8050C-part2 -> ../../sda2
lrwxrwxrwx 1 root root  10 out 11 09:48 ata-KINGSTON_SEDC600M480G_50026B7686B8050C-part5 -> ../../sda5
lrwxrwxrwx 1 root root   9 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX -> ../../sdb
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX-part2 -> ../../sdb2
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX-part3 -> ../../sdb3
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX-part4 -> ../../sdb4
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB1000GCWCV_Z1W4EGFX-part5 -> ../../sdb5
lrwxrwxrwx 1 root root   9 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E -> ../../sdc
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E-part1 -> ../../sdc1
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E-part2 -> ../../sdc2
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E-part3 -> ../../sdc3
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E-part4 -> ../../sdc4
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB1000GCWCV_Z1W4SP1E-part5 -> ../../sdc5
lrwxrwxrwx 1 root root   9 out 14 13:18 ata-MB2000GDUNV_26CBK12XF1BA -> ../../sdd
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB2000GDUNV_26CBK12XF1BA-part1 -> ../../sdd1
lrwxrwxrwx 1 root root  10 out 14 13:18 ata-MB2000GDUNV_26CBK12XF1BA-part2 -> ../../sdd2
lrwxrwxrwx 1 root root   9 out 14 13:18 wwn-0x50000396dbc008fa -> ../../sdd
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x50000396dbc008fa-part1 -> ../../sdd1
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x50000396dbc008fa-part2 -> ../../sdd2
lrwxrwxrwx 1 root root   9 out 14 13:18 wwn-0x5000c50086fee3f7 -> ../../sdb
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x5000c50086fee3f7-part1 -> ../../sdb1
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x5000c50086fee3f7-part2 -> ../../sdb2
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x5000c50086fee3f7-part3 -> ../../sdb3
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x5000c50086fee3f7-part4 -> ../../sdb4
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x5000c50086fee3f7-part5 -> ../../sdb5
lrwxrwxrwx 1 root root   9 out 14 13:18 wwn-0x5000c5008798a3d3 -> ../../sdc
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x5000c5008798a3d3-part1 -> ../../sdc1
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x5000c5008798a3d3-part2 -> ../../sdc2
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x5000c5008798a3d3-part3 -> ../../sdc3
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x5000c5008798a3d3-part4 -> ../../sdc4
lrwxrwxrwx 1 root root  10 out 14 13:18 wwn-0x5000c5008798a3d3-part5 -> ../../sdc5
lrwxrwxrwx 1 root root   9 out 11 09:48 wwn-0x50026b7686b8050c -> ../../sda
lrwxrwxrwx 1 root root  10 out 11 09:48 wwn-0x50026b7686b8050c-part1 -> ../../sda1
lrwxrwxrwx 1 root root  10 out 11 09:48 wwn-0x50026b7686b8050c-part2 -> ../../sda2
lrwxrwxrwx 1 root root  10 out 11 09:48 wwn-0x50026b7686b8050c-part5 -> ../../sda5

3ª Passo – Agora iremos anexar os discos a vm com o seguinte comando, para isso efeteu login como administrador no shell do seu servidor linux.

qm set 100 -sata3 /dev/disk/by-id/wwn-0x5000c5008798a3d3

Onde:

  • qm set  =  Comando do proxmox para configurar um Host Guest
  • 100 = ID do Host ( no meu caso um servidor Windows)
  • -sataX = -Tipo de controladora que vai ser utilizada, pode ser sata ou scsi o X representa o número
  • /dev/disk/by-id/wwn-0x5000c5008798a3d3 = E por fim o identifacador do disco, pode ser o wwn- ou ata- ( /dev/disk/by-id/wwn-0x5000c5008798a3d3 ou ata-MB2000GDUNV_26CBK12XF1BA) tanto faz.

 

 

[Solved] Linux: High swap space usage (less than 50% free)

Esse aviso no cliente do zabbix informa que o espaçõ pra swap está com mais de 50% ocupado.

Para resolver esse problema você pode adicionar um swapfile

  • Crie um arquivo Swapfile na raiz do linux
fallocate -l 1GB /swapfile
  • Preencha esse arquivo com 0 bits
dd if=/dev/zero of=/swapfile bs=1M count=1024 oflag=append conv=notrunc
  • Formate para tipo swapfile
mkswap /swapfile
  • Ajuste as permissões
chmod 600 /swapfile
  • Ative o arquivo de swap
swapon /swapfile

 

Deploy de Aplicação em Django com uWSGI e Nginx

Nesse tutorial iremos realizar o deploy de uma aplicação em Django com uWSGI e Nginx

1 – Realizar o update do apt

apt-get update
apt-get upgrade

2 – Instalar dependências

apt install git gcc nginx certbot python3-dev python3.11-venv

3 – Criar diretório do projeto

mkdir /videoaula
cd /videoaula

4 – Criar e ativar o ambiente virtual

python3 -m venv venv
source venv/bin/activate

5 – Instalar os  pacotes

pip install django uwsgi

6 – Iniciar o projeto

python3 -m django --version
django-admin startproject videoaula .
python3 manage.py runserver 0.0.0.0:8000
  • Acesse o host no porta 8000 verifique se aplicação django esta presente.

7 – Ajustar o setting.py

  • Configurar o allowed hosts e a static url
  • Aproveite para checar a aplicação
  • python3 manage.py runserver 0.0.0.0:8000
vim videoaula/settings.py
import os

ALLOWED_HOSTS = ['*']

STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, "static/")

8 – Testando manualmente o uWSGI

  • Crie um arquivo teste.py com o seguinte conteúdo.
def application(env, start_response):
    start_response('200 OK', [('Content-Type','text/html')])
    return [b"Hello World!"]
  • uwsgi –http :8000 –wsgi-file teste.py

Acesse o host na porta 8000 e confirme se o Hello World foi redenrizado.

9 – Testando o projeto vídeo aula com uWSGI usando o IP Socket

  1. Acesse a aplicação via uWSGI para simples conferência.
uwsgi --http :8000 --module videoaula.wsgi

10 – Configurando o Nginx para acessar aplicação via Unix Socket

  • Crie o arquivo .conf dentro de vim /etc/nginx/sites-available/videoaula.conf
  • Preencha com seguinte conteúdo.
# Configuração do Servidor

upstream django {
    server unix:///videoaula/videoaula.sock;
    }


server {
    listen      80;
    server_name videoaula.cuidadodigital.com.br;
    charset     utf-8;
    
    # max upload size
    client_max_body_size 75M;
    
    # Django media and static files
    location /media  {
        alias /videoaula/media;
    }
    #Django static
    location /static {
        alias /videoaula/static;
    }
    # Send all non-media requests to the Django server.
    location / {
        uwsgi_pass  django;
        include     /videoaula/uwsgi_params;
    }
}
  • Crei o uwsgi_params dentro de /video/aula
  • vim /videoaula/uwsgi_params
uwsgi_param  QUERY_STRING       $query_string;
uwsgi_param  REQUEST_METHOD     $request_method;
uwsgi_param  CONTENT_TYPE       $content_type;
uwsgi_param  CONTENT_LENGTH     $content_length;
uwsgi_param  REQUEST_URI        $request_uri;
uwsgi_param  PATH_INFO          $document_uri;
uwsgi_param  DOCUMENT_ROOT      $document_root;
uwsgi_param  SERVER_PROTOCOL    $server_protocol;
uwsgi_param  REQUEST_SCHEME     $scheme;
uwsgi_param  HTTPS              $https if_not_empty;
uwsgi_param  REMOTE_ADDR        $remote_addr;
uwsgi_param  REMOTE_PORT        $remote_port;
uwsgi_param  SERVER_PORT        $server_port;
uwsgi_param  SERVER_NAME        $server_name;
  • Crie um Link Simbólico do videoaula.conf de sites-availabe para sites-enable
ln -s /etc/nginx/sites-available/videoaula.conf /etc/nginx/sites-enabled/
  • Cheque as configurações do ngnix: # ngnix -t
  • Habilite o nginx: # systemct enable nginx
  • Reinicie o nginx: # systemct restart nginx

11 –  Testando aplicação via Unix Socket

uwsgi --socket videoaula.sock --module videoaula.wsgi --chmod-socket=666 --uid www-data
  • Nessa etapa a aplicação ja deve estar funcionando, poém como aplicação e não como serviço

12 – Crei o arquivo de configuração que o demom irá utilizar para chamar uWSGI com serviço

  • vim /videoaula/videoaula_uwsgi.ini
[uwsgi]
# full path to Django project's root directory
chdir = /videoaula
# Django's wsgi file
module = videoaula.wsgi
# full path to python virtual env
home = /videoaula/venv
# enable uwsgi master process
master = true
# maximum number of worker processes
processes = 10
# the socket (use the full path to be safe
socket = /videoaula/videoaula.sock
# socket permissions
chmod-socket = 666
# User ID
uid = www-data
# Group ID
gid = www-data
# clear environment on exit
vacuum = true
# daemonize uwsgi and write messages into given log
daemonize = /videoaula/uwsgi-emperor.log

13 – Testando a aplicação com paramentros de inicialização

uwsgi --ini videoaula_uwsgi.ini

15 – Configurando o vassals

mkdir -p /videoaula/venv/vassals
ln -s /videoaula/videoaula_uwsgi.ini /videoaula/venv/vassals/

16 – Teste final. Realizado teste em modo Emperador do uWSGI emperor mode

uwsgi --emperor /videoaula/venv/vassals --uid www-data --gid www-data

17 – Criando serviço no linux Daemon

  • Crie o arquivo videoaula-uwsgi-emperor.service
  • vim /etc/systemd/system/videoaula-uwsgi-emperor.service
  • Preencha com as seguintes configurações
[Unit]
Description=App Django - Video Aula
After=network.target

[Service]
User=admin
Restart=always
ExecStart=/videoaula/venv/bin/uwsgi --emperor /videoaula/venv/vassals --uid www-data --gid www-data

[Install]
WantedBy=multi-user.target
  • Para habilitar o serviço : systemctl enable videoaula-uwsgi-emperor.service
  • Para iniciar o serviço: systemctl start videoaula-uwsgi-emperor.service

Inpirado em: https://tonyteaches.tech/django-nginx-uwsgi-tutorial/

Como converter Windows 10 Home para Windows 10 Pro

Abra o prompt de comando como Administrador

Execute os seguintes comandos para remover a chave da versão Home

slmgr.vbs /upk 
slmgr.vbs /cpky 
slmgr.vbs /ckms

Para instalar o chave do Windows pro Execute

 

sc config LicenseManager start= auto & net start LicenseManager
sc config wuauserv start= auto & net start wuauserv
changepk.exe /productkey VK7JG-NPHTM-C97JM-9MPGT-3V66T
exit

 

Após reiniciar o computador o mesmo ja iniciará como Windows Pro