Skip to content

Instantly share code, notes, and snippets.

View antoniocampos's full-sized avatar
🙈

Antonio Campos antoniocampos

🙈
View GitHub Profile
@antoniocampos
antoniocampos / Gerar.cmd
Last active June 28, 2023 20:49
Generate UBL-ApplicationResponse-2.1 c# class
xsd maindoc\UBL-ApplicationResponse-2.1.xsd common\UBL-CommonAggregateComponents-2.1.xsd common\UBL-CommonBasicComponents-2.1.xsd common\UBL-CommonExtensionComponents-2.1.xsd common\UBL-QualifiedDataTypes-2.1.xsd common\UBL-UnqualifiedDataTypes-2.1.xsd common\CCTS_CCT_SchemaModule-2.1.xsd /classes /namespace:UBL_ACAMPOS /nologo /order
@antoniocampos
antoniocampos / Install.sh
Last active January 27, 2023 12:11
Debian 10 install and configure Microsoft SQL Server 2019 and tools
apt install curl apt-transport-https gnupg
curl https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
curl https://packages.microsoft.com/config/debian/10/prod.list | tee /etc/apt/sources.list.d/msprod.list
curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list | tee /etc/apt/sources.list.d/msprod.list
apt-get update
apt-get install -y mssql-server mssql-tools unixodbc-dev
echo 'export PATH="$PATH:/opt/mssql-tools/bin"' >> ~/.bash_profile
source ~/.bashrc
/opt/mssql/bin/mssql-conf setup
# follow the steps!
@antoniocampos
antoniocampos / readme.md
Last active January 27, 2023 12:11
Python validar SAF-T_PT 1.04_01
  • Se ainda não tens... instala o python https://www.python.org/downloads/

  • depois fazes download do ficheiro validar.py

  • e também do saftpt1.04_01.xsd

  • mete ambos numa pasta

  • para ser mais simples arrasta o ficheiro do saft para cima do validar.py

  • o processo de validação vai iniciar, caso haja algum erro aparece o motivo do erro e o valor com erro!

@antoniocampos
antoniocampos / debian10+apache2+mariadb+php
Created March 12, 2020 14:56
Debian 10 Install Apache2 + Mariadb + PHP
# install apache
apt-get install apache2
# install MariaDB
apt install mariadb-server
# configure MariaDb root Password
mysql_secure_installation
# install php and configure apache
apt install php libapache2-mod-php php-gd php-mysql php-pear libgd-tools
@antoniocampos
antoniocampos / MyService.service
Last active March 29, 2024 16:44
.net Core Systemd Service Example (Linux autostart you .net app)
[Unit]
Description=MyService Description
[Service]
WorkingDirectory=/path/to/app/
ExecStart=/usr/bin/dotnet /path/to/app/App.dll
Restart=always
# Restart service after 10 seconds if the dotnet service crashes:
RestartSec=10
KillSignal=SIGINT
@antoniocampos
antoniocampos / iptables-blocktype.conf
Last active March 10, 2021 16:37
Fail2Ban DROP instead REJECT
#Depending on version one of the following files must exist
root@host:/ nano /etc/fail2ban/action.d/iptables-blocktype.conf
or
root@host:/ nano /etc/fail2ban/action.d/iptables-common.conf
comment the line
@davidfowl
davidfowl / dotnetlayout.md
Last active April 26, 2024 13:37
.NET project structure
$/
  artifacts/
  build/
  docs/
  lib/
  packages/
  samples/
  src/
 tests/