var base64Data = req.rawBody.replace(/^application\/pdf;base64,/, "");
require("fs").writeFile("out.pdf", base64Data, 'base64', function(err) {
console.log(err);
});
Configuring an IP address with DHCP
NOTE
DHCP is not supported for IPv6 addresses.
By default, DHCP is disabled. You must explicitly enable the service. Use the ip address dhcp
command to enable DHCP for IPv4 addresses, and the ipv6 address dhcp command to enable
DHCP for IPv6 addresses. The Network OS DHCP clients support the following parameters:
• External Ethernet port IP addresses and prefix length
• Default gateway IP address
When you connect the DHCP-enabled switch to the network and power on the switch, the switch
automatically obtains the Ethernet IP address, prefix length, and default gateway address from the
DHCP server. The DHCP client can only connect to a DHCP server on the same subnet as the
switch. Do not enable DHCP if the DHCP server is not on the same subnet as the switch.
The following example enables DHCP for IPv4 addresses.
switch(config)# interface management 1/1
switch(config-Management-1/1)# ip address dhcp
The following example enables DHCP for IPv6 addresses.
switch(config)# interface management 1/1
switch(config-Management-1/1)# ipv6 address dhcp
The show running-config interface management command indicates whether DHCP is enabled. The
following example shows a switch with DHCP enabled for IPv4 addresses.
switch# show running-config interface management
interface Management 2/0
ip address dhcp
ip route 0.0.0.0/0 10.24.80.1
ip address 10.24.73.170/20
[STAThread]
static void Main(string[] args)
что нужно продавать, чтобы такую комиссию получить?
#region License
// // Ðàçðàáîòàíî: Êîðîòåíêî Âëàäèìèðîì Íèêîëàåâè÷åì (Vladimir N. Korotenko)
// // email: koroten@ya.ru
// // skype:vladimir-korotenko
// // https://vkorotenko.ru
// // Ñîçäàíî: 09.08.2020 7:18
#endregion
using Kvn.ErrorReport.Data;
using Kvn.ErrorReport.Models;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
namespace Kvn.ErrorReport.Pages
{
/// <summary>
/// Ìîäåëü ïðîôèëÿ, ãîëîâíàÿ ìîäåëü äëÿ îòîáðàæåíèÿ àäìèíèñòðàòîðó ñèñòåìû
/// </summary>
[Authorize(Roles = "admin")]
public class ProfileModel : PageModel
{
private readonly ApplicationDbContext _ctx;
private readonly AppSettings _settings;
/// <summary>
/// Êîíñòðóêòîð ìîäåëè
/// </summary>
/// <param name="ctx"></param>
/// <param name="settings"></param>
public ProfileModel(ApplicationDbContext ctx, IOptions<AppSettings> settings)
{
_ctx = ctx;
_settings = settings.Value;
}
#region Ñâîéñòâà
/// <summary>
/// Ïðèëîæåíèå êîòîðîå ñìîòðèì.
/// </summary>
[BindProperty(SupportsGet = true)]
public int? Id { get; set; }
/// <summary>
/// Ìîäåëü ñòðàíèöû
/// </summary>
public ProfileViewModel PageViewModel { get; set; }
/// <summary>
/// Ñïèñîê ïðèëîæåíèé
/// </summary>
public List<SelectListItem> Options { get; set; }
/// <summary>
/// Âûáðàííîå ïðèëîæåíèå
/// </summary>
[BindProperty]
public string SelectedOptions { get; set; }
/// <summary>
/// Ýëåìåíòû îò÷åòà
/// </summary>
public List<ReportItemModel> ReportItems { get; set; }
#endregion
#region Îáðàáîò÷èêè
/// <summary>
/// Îáðàáîò÷èê ñòðàíèöû
/// </summary>
public async Task OnGet(int p = 1)
{
Options = await _ctx.Applications.Select(a =>
new SelectListItem
{
Value = a.Id.ToString(),
Text = a.Name
}).ToListAsync();
ApplicationDbItem app;
if (Id != null)
{
app = _ctx.Applications.FirstOrDefault(x => x.Id == Id.Value);
foreach (var item in Options.Where(item => item.Value == Id.Value.ToString()))
{
item.Selected = true;
}
}
else
{
app = _ctx.Applications.FirstOrDefault();
}
const int pageSize = 10; // êîëè÷åñòâî ýëåìåíòîâ íà ñòðàíèöå
var source = _ctx.Reports.Where(x => x.ApplicationId == app.Id);
var count = await source.CountAsync();
var items = await source.Skip((p - 1) * pageSize).Take(pageSize).ToListAsync();
var pageViewModel = new ProfileViewModel(count, p, pageSize);
PageViewModel = pageViewModel;
ReportItems = new List<ReportItemModel>();
foreach (var item in items)
{
ReportItems.Add(new ReportItemModel()
{
Application = app.Name,
Id = item.Id,
Created = item.Created,
Email = item.Email,
Hardware = item.HardwareId,
Ip = ByteToIpAddress(item.Ip),
Files = await GetFiles(item.Id)
});
}
}
private async Task<FileItemModel[]> GetFiles(int id)
{
var items = await _ctx.Files.Where(x => x.ReportId == id).ToListAsync();
return items.Select(item => new FileItemModel() { Id = item.Id, Name = item.Name }).ToArray();
}
/// <summary>
/// Âûáîðêà ïðèëîæåíèÿ
/// </summary>
/// <returns></returns>
public IActionResult OnPostFilterGenerated()
{
return RedirectToPage("Profile", new { id = SelectedOptions });
}
/// <summary>
/// Óäàëåíèå ðåïîðòà
/// </summary>
/// <param name="id"></param>
/// <param name="delid"></param>
/// <param name="p"></param>
/// <returns></returns>
public async Task<IActionResult> OnPostDeleteAsync(int delid, int id, int p)
{
var item = await _ctx.Reports.FindAsync(delid);
if (item == null) return RedirectToPage("Profile", new { id = id, p = p });
_ctx.Reports.Remove(item);
await _ctx.SaveChangesAsync();
var dirPath = Path.Combine(_settings.StoreDir, delid.ToString());
if (Directory.Exists(dirPath)) Directory.Delete(dirPath, true);
return RedirectToPage("Profile", new { id = id, p = p });
}
#endregion
private static string ByteToIpAddress(byte[] bytes)
{
var ip = new IPAddress(bytes).ToString();
ip = ip.Replace("::ffff:", "");
return ip;
}
}
}
<div class="navbar-start">
<a class="navbar-item" asp-area="" asp-page="/Index">
Главная
</a>
<a class="navbar-item" asp-area="" asp-page="/Privacy">
Политика конфиденциальности
</a>
</div>
<a asp-page="Edit" asp-route-id="@item.Id">Изменить</a>
<a asp-page="Edit" asp-route-id="@Model.UrlString">Изменить</a>
Обычные требования хостеров это энергопотребление, отсутствие левого трафика, определенные требования к железу. Все.
А вот водянку не приемлют.
Да и i9 странный проц для сервера, рабочая станция да, 1С может быть, но сервер игры как то странно. Похоже на развод этого хостера.
ПС 95 ватт TDP это вообще ни о чем. Калориферы от AMD до 250 вытягивают.