This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| PS1='\[\033]0;$TITLEPREFIX:\W\007\]' # set window title | |
| PS1="$PS1"'\n' # new line | |
| PS1="$PS1"'\[\033[32m\]' # change to green | |
| PS1="$PS1"'git@local ' # user@host<space> | |
| PS1="$PS1"'\[\033[35m\]' # change to purple | |
| PS1="$PS1"'$MSYSTEM ' # show MSYSTEM | |
| PS1="$PS1"'\[\033[33m\]' # change to brownish yellow | |
| PS1="$PS1"'\W' # current working directory | |
| if test -z "$WINELOADERNOEXEC" | |
| then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| \a an ASCII bell character (07) | |
| \d the date in "Weekday Month Date" format (e.g., "Tue May 26") | |
| \e an ASCII escape character (033) | |
| \h the hostname up to the first '.' | |
| \H the hostname | |
| \j the number of jobs currently managed by the shell | |
| \l the basename of the shell's terminal device name | |
| \n newline | |
| \r carriage return | |
| \s the name of the shell, the basename of $0 (the portion following the final slash) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if test -f /etc/profile.d/git-sdk.sh | |
| then | |
| TITLEPREFIX=SDK-${MSYSTEM#MINGW} | |
| else | |
| TITLEPREFIX=$MSYSTEM | |
| fi | |
| if test -f ~/.config/git/git-prompt.sh | |
| then | |
| . ~/.config/git/git-prompt.sh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SftpService | |
| { | |
| private readonly ILogger<SftpService> _logger; | |
| private readonly SftpConfig _config; | |
| public SftpService(ILogger<SftpService> logger, SftpConfig sftpConfig) | |
| { | |
| _logger = logger; | |
| _config = sftpConfig; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var config = new SftpConfig | |
| { | |
| Host = "test.rebex.net", | |
| Port = 22, | |
| UserName = "demo", | |
| Password = "password" | |
| }; // can be retrieved from appsettings.json | |
| using var client = new SftpClient(config.Host, config.Port, config.UserName, config.Password); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class SftpConfig | |
| { | |
| public string Host { get; set; } | |
| public int Port { get; set; } | |
| public string UserName { get; set; } | |
| public string Password { get; set; } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| version: '3.8' | |
| services: | |
| rabbitmq: | |
| image: rabbitmq:3-management-alpine | |
| hostname: my-rabbit | |
| container_name: rabbitmq | |
| volumes: | |
| - ./rabbitmq/etc/definitions.json:/etc/rabbitmq/definitions.json | |
| - ./rabbitmq/etc/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM mcr.microsoft.com/dotnet/core/sdk:3.1-alpine AS build | |
| WORKDIR /app | |
| COPY ./*.csproj ./ | |
| RUN dotnet restore | |
| COPY . . | |
| RUN dotnet publish -c Release -o /out --no-restore | |
| FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-alpine AS runtime | |
| WORKDIR /app | |
| COPY --from=build /out ./ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class OrdersController : ControllerBase | |
| { | |
| private readonly ILogger<OrdersController> _logger; | |
| private readonly IRabbitMQClient _rabbitMqClient; | |
| public OrdersController(ILogger<OrdersController> logger, IRabbitMQClient rabbitMqClient) | |
| { | |
| _logger = logger; | |
| _rabbitMqClient = rabbitMqClient; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public void ConfigureServices(IServiceCollection services) | |
| { | |
| // ... | |
| services.AddSingleton(rabbitMqConnection); | |
| services.AddSingleton<IRabbitMQClient, RabbitMQClient>(); | |
| // ... | |
| } |