{"id":18195766,"url":"https://github.com/sschonss/auto-print","last_synced_at":"2025-10-16T22:47:58.436Z","repository":{"id":215633065,"uuid":"739127929","full_name":"sschonss/auto-print","owner":"sschonss","description":"Print Image Anywhere","archived":false,"fork":false,"pushed_at":"2024-01-10T18:42:40.000Z","size":43016,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-13T19:22:00.052Z","etag":null,"topics":["bash","golang","powershell"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sschonss.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-04T20:50:15.000Z","updated_at":"2024-01-08T18:39:06.000Z","dependencies_parsed_at":"2024-06-21T04:08:49.578Z","dependency_job_id":"4a646475-3a43-484f-a4f6-6922ce961af3","html_url":"https://github.com/sschonss/auto-print","commit_stats":null,"previous_names":["sschonss/auto-print"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschonss%2Fauto-print","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschonss%2Fauto-print/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschonss%2Fauto-print/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sschonss%2Fauto-print/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sschonss","download_url":"https://codeload.github.com/sschonss/auto-print/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694876,"owners_count":20980733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bash","golang","powershell"],"created_at":"2024-11-03T08:04:51.465Z","updated_at":"2025-10-16T22:47:53.365Z","avatar_url":"https://github.com/sschonss.png","language":"Go","readme":"# AutoPrinter\n\n## Português / Portuguese\n\nEste sistema foi desenvolvido para automatizar o processo de impressão de imagens em uma impressora específica, registrando informações relevantes em um arquivo de log. O sistema possui dois scripts, um em Bash e outro em PowerShell, para sistemas Unix-like e Windows, respectivamente.\nFuncionalidades:\n\n- Automatização da Impressão:\n        Os scripts aceitam o nome da imagem como parâmetro e verificam se o arquivo existe no diretório especificado.\n        Caso a extensão da imagem não seja fornecida, o sistema acrescenta automaticamente a extensão '.jpeg' para facilitar o processo.\n\n- Registro de Logs:\n        Durante o processo de impressão, os scripts registram as seguintes informações no arquivo de log:\n            Data e hora de início da impressão.\n            Informações sobre a imagem e a impressora utilizada.\n            Data e hora de conclusão da impressão.\n\n### Uso:\n\nAcesse o diretório de scripts e execute o script correspondente ao seu sistema operacional.\n\n- Bash (Sistemas Unix-like):\n        Para utilizar o script em Bash, execute-o no terminal fornecendo o nome do arquivo como argumento. Exemplo:\n\n```bash\n./autoprinter.sh \"nome_da_imagem\" \"numero_de_copias\" \"sistema_operacional\"\n```\n\n- PowerShell (Windows):\n\n    No PowerShell, execute o script fornecendo o nome do arquivo como argumento. Exemplo:\n\n```arduino\n.\\autoprinter.ps1 \"nome_da_imagem\" \"numero_de_copias\" \"sistema_operacional\"\n```\n\n### API Server (Go):\n\nPara rodar a aplicação de forma mais eficiente e profissional, vamos usar uma API em Go para automatizar a execução dos scripts.\n\nAcesse o diretório `server` e execute os passos abaixo.\n\nVocê pode usar o comando `go run main.go` para rodar a aplicação, ou `go build main.go` para gerar um executável.\n\n#### Build\n\nCaso você queira buildar seu projeto, rode o seguinte comando no terminal:\n\n```bash\ngo build -o \u003cnome_do_executavel\u003e\n```\n\nNo nosso caso, estamos usando o nome `autoprinter`, então o comando fica:\n\n```bash\ngo build -o autoprinter\n```\n\nLembre-se de que após o build, o arquivo só pode ser executado em sistemas operacionais compatíveis com o seu sistema de desenvolvimento. Por exemplo, se você estiver desenvolvendo no Windows, o executável só poderá ser executado em sistemas Windows.\n\nMas caso você queira buildar para outros sistemas, você pode usar o seguinte comando:\n\n```bash\nGOOS=\u003csistema_operacional\u003e GOARCH=\u003carquitetura\u003e go build -o \u003cnome_do_executavel\u003e\n```\n\nPor exemplo, para buildar para Windows, você pode usar:\n\n```bash\nGOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -o nome_do_arquivo_windows.exe\n```\n\nCaso você queira buildar para Linux, você pode usar:\n\n```bash\nGOOS=linux GOARCH=amd64 go build -o nome_do_arquivo_linux\n```\n\nMuitas vezes, o comando acima não funciona, por que o compilador não está instalado. Para instalar o compilador, você pode usar o seguinte comando:\n\n```bash\nsudo apt install gcc-mingw-w64-x86-64\n```\n\n#### Execução\n\nPara executar o programa, você pode usar o seguinte comando:\n\n```bash\n./autoprinter\n```\n\nCaso você tenha buildado para outro sistema, você pode usar o seguinte comando:\n\n```bash\n./nome_do_executavel\n```\n\nLogo após a execução, o programa irá rodar na porta 8080. Para acessar a API, você pode usar o seguinte link:\n\n```bash\nhttp://localhost:8080/print\n```\n\nLá ira conter as instruções para a utilização da API.\n\n#### Observações\n\nPode ser que ao rodar no Windows, você receba um erro de permissão. Para resolver isso, você pode usar o seguinte comando:\n\n```bash\nSet-ExecutionPolicy RemoteSigned\n```\n\n---\n\n## Inglês / English\n\nThis system was developed to automate the process of printing images on a specific printer while logging relevant information to a log file. The system consists of two scripts, one in Bash for Unix-like systems and another in PowerShell for Windows, respectively.Features:\n\n- Automated Printing:\n        The scripts accept the image name as a parameter and check if the file exists in the specified directory.\n        If the image extension is not provided, the system automatically appends the '.jpeg' extension for convenience.\n\n- Logging:\n        During the printing process, the scripts log the following information to the log file:\n            Start date and time of the printing process.\n            Information about the image and the printer used.\n            Completion date and time of the printing process.\n\n### Usage:\n\n- Bash (Unix-like Systems):\n        To use the Bash script, execute it in the terminal providing the image name as an argument. Example:\n\n```bash\n./autoprinter.sh \"image_name\" \"number_of_copies\" \"operating_system\"\n```\n\n- PowerShell (Windows):\n\n    In PowerShell, execute the script providing the image name as an argument. Example:\n\n```arduino\n.\\autoprinter.ps1 \"image_name\" \"number_of_copies\" \"operating_system\"\n```\n\n### API Server (Go):\n\nYou can use the command go run main.go to run the application, or go build main.go to generate an executable.\nBuild\n\nAccess the `server` directory and follow the steps below.\n\nIf you want to build your project, run the following command in the terminal:\n\n```bash\ngo build -o \u003cexecutable_name\u003e\n```\n\nIn our case, we're using the name autoprinter, so the command is:\n\n```bash\ngo build -o autoprinter\n```\n\nRemember that after the build, the file can only be executed on operating systems compatible with your development system. For example, if you're developing on Windows, the executable can only be run on Windows systems.\n\nBut if you want to build for other systems, you can use the following command:\n\n```bash\nGOOS=\u003coperating_system\u003e GOARCH=\u003carchitecture\u003e go build -o \u003cexecutable_name\u003e\n```\n\nFor example, to build for Windows, you can use:\n\n```bash\nGOOS=windows GOARCH=amd64 CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc go build -o filename_windows.exe\n```\n\nIf you want to build for Linux, you can use:\n\n```bash\nGOOS=linux GOARCH=amd64 go build -o filename_linux\n```\n\nOften, the above command doesn't work because the compiler isn't installed. To install the compiler, you can use the following command:\n\n```bash\nsudo apt install gcc-mingw-w64-x86-64\n```\n\n### Execution\n\nTo run the program, you can use the following command:\n\n```bash\n./autoprinter\n```\n\nIf you've built for another system, you can use the following command:\n\n```bash\n./executable_name\n```\n\nImmediately after execution, the program will run on port 8080. To access the API, you can use the following link:\n\n```bash\nhttp://localhost:8080/print\n```\n\nThere, you'll find instructions for using the API.\n\n### Notes\n\nWhen running on Windows, you may receive a permission error. To fix this, you can use the following command:\n\n```bash\nSet-ExecutionPolicy RemoteSigned\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsschonss%2Fauto-print","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsschonss%2Fauto-print","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsschonss%2Fauto-print/lists"}