This file contains 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
#!/bin/bash | |
FLAG="/path/to/log/getMacAddress.log" | |
if [ ! -f $FLAG ]; then | |
echo "Getting Mac address" | |
ifconfig eth0 | grep -Po 'HWaddr \K.*$' > "/path/to/destinationFile/$(cat /etc/hostname).txt" | |
touch $FLAG | |
fi |
This file contains 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
$ips = @("192.168.1.90"); | |
$rpiFolder = "/home/pi/Documents"; | |
$destFolder = "F:\DEV\blog\"; | |
$myPiPassword = Get-Content -Path "F:\DEV\blog\myPiPassword.txt" | |
foreach($ip in $ips){ | |
Write-Host $ip | |
$scriptBlock = [scriptblock]::Create("pscp -l pi -pw $myPiPassword pi@$($ip):$($rpiFolder)/*.txt $($destFolder)") | |
Invoke-Command -ScriptBlock $scriptBlock | |
} |
This file contains 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
namespace Microsoft.AspNetCore.SignalR | |
{ | |
public class Hub : IDisposable | |
{ | |
public Hub(); | |
public IHubClients Clients { get; set; } | |
public HubCallerContext Context { get; set; } | |
public IGroupManager Groups { get; set; } |
This file contains 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
namespace Microsoft.AspNetCore.SignalR | |
{ | |
public interface IHubClients<T> | |
{ | |
T All { get; } | |
T AllExcept(IReadOnlyList<string> excludedIds); | |
T Client(string connectionId); | |
T Group(string groupName); | |
T User(string userId); |
This file contains 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
namespace Microsoft.AspNetCore.SignalR | |
{ | |
public interface IHubClients : IHubClients<IClientProxy> | |
{ | |
} | |
} |
This file contains 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
namespace Microsoft.AspNetCore.SignalR | |
{ | |
public interface IClientProxy | |
{ | |
// | |
// Summary: | |
// Invokes a method on the connection(s) represented by the Microsoft.AspNetCore.SignalR.IClientProxy | |
// instance. | |
// | |
// Parameters: |
This file contains 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
Clients.Group(“SomeGroup”).InvokeAsync(“SomeMethod”, “someParameters”). |
This file contains 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
namespace Microsoft.AspNetCore.SignalR | |
{ | |
public interface IGroupManager | |
{ | |
Task AddAsync(string connectionId, string groupName); | |
Task RemoveAsync(string connectionId, string groupName); | |
} | |
} |
This file contains 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
namespace Employee_SignalR | |
{ | |
public class EntryPoint : Hub | |
{ | |
public void BroadcastToGroupName(string groupName, string information) | |
{ | |
Clients.Group(groupName).InvokeAsync("ClientMethod", $"{information} - {groupName}"); | |
} | |
This file contains 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.AddSignalR(); | |
} | |
public void Configure(IApplicationBuilder app, IHostingEnvironment env) | |
{ | |
if (env.IsDevelopment()) | |
{ | |
app.UseDeveloperExceptionPage(); |
OlderNewer