http://logicalgenetics.com/raspberry-pi-and-mono-hello-world/
http://blog.bennymichielsen.be/2016/03/14/getting-up-and-running-with-mono-and-raspberry-pi-3/
http://www.mono-project.com/download/#download-lin
meine Sys/Db admin & Developper Notitzen - wer Rechtschreibfehler findet darf sie behalten ... my Sys/Db Admin and developper notes - I don't care about typos
Wednesday, August 16, 2017
Thursday, August 10, 2017
using raspberry samba accounts from windows
login with windows explorer failes sometimes - so use:
net use driveletter uncpath /USER:sambauser
net use z: \\192.168.1.4\varbak /USER:sambauser
net use driveletter uncpath /USER:sambauser
net use z: \\192.168.1.4\varbak /USER:sambauser
OsMc auf Raspy pi
Raspi Pi 1:
- von NTFS (Schwarz weiß) auf PAL umschalten
- Zoom einstellen
Pi3:
Audio von hdmi auf klinkenbuchse umstellen
- von NTFS (Schwarz weiß) auf PAL umschalten
- Zoom einstellen
Pi3:
Audio von hdmi auf klinkenbuchse umstellen
raspberry sd card backup in image file
dd ... tool zum bitgenauen kopieren von hds usw
if ... in file
of ... out file
mmcblk0 ... sdcard 0
sudo dd if=/dev/mmcblk0 of=./20170810pi3Exp.img
if ... in file
of ... out file
mmcblk0 ... sdcard 0
sudo dd if=/dev/mmcblk0 of=./20170810pi3Exp.img
Add Logfile To NLOG Config
public static void AddLogFileToParent(string subLogDir)
{
var logDir = Path.Combine(subLogDir, "..");
Trace.WriteLine("Adding logfile.txt to" + logDir);
var config = LogManager.Configuration;
var logFile = new FileTarget();
config.AddTarget("file", logFile);
logFile.FileName = logDir + "\\logfile.txt";
logFile.Layout = "${date} | ${message}";
var rule = new LoggingRule("*", LogLevel.Info, logFile);
config.LoggingRules.Add(rule);
LogManager.Configuration = config;
}
{
var logDir = Path.Combine(subLogDir, "..");
Trace.WriteLine("Adding logfile.txt to" + logDir);
var config = LogManager.Configuration;
var logFile = new FileTarget();
config.AddTarget("file", logFile);
logFile.FileName = logDir + "\\logfile.txt";
logFile.Layout = "${date} | ${message}";
var rule = new LoggingRule("*", LogLevel.Info, logFile);
config.LoggingRules.Add(rule);
LogManager.Configuration = config;
}
init NLOG by Code
private static void InitLogger()
{
// Step 1. Create configuration object
var config = new LoggingConfiguration();
// Step 2. Create targets and add them to the configuration
var consoleTarget = new ColoredConsoleTarget();
config.AddTarget("console", consoleTarget);
var fileTarget = new FileTarget();
config.AddTarget("file", fileTarget);
// Step 3. Set target properties
consoleTarget.Layout = @"${date:format=HH\:mm\:ss} ${logger} ${message}";
fileTarget.FileName = "${basedir}/file.txt";
fileTarget.Layout = "${message}";
// Step 4. Define rules
var rule1 = new LoggingRule("*", LogLevel.Debug, consoleTarget);
config.LoggingRules.Add(rule1);
var rule2 = new LoggingRule("*", LogLevel.Debug, fileTarget);
config.LoggingRules.Add(rule2);
// Step 5. Activate the configuration
LogManager.Configuration = config;
LogManager.ReconfigExistingLoggers();
}
{
// Step 1. Create configuration object
var config = new LoggingConfiguration();
// Step 2. Create targets and add them to the configuration
var consoleTarget = new ColoredConsoleTarget();
config.AddTarget("console", consoleTarget);
var fileTarget = new FileTarget();
config.AddTarget("file", fileTarget);
// Step 3. Set target properties
consoleTarget.Layout = @"${date:format=HH\:mm\:ss} ${logger} ${message}";
fileTarget.FileName = "${basedir}/file.txt";
fileTarget.Layout = "${message}";
// Step 4. Define rules
var rule1 = new LoggingRule("*", LogLevel.Debug, consoleTarget);
config.LoggingRules.Add(rule1);
var rule2 = new LoggingRule("*", LogLevel.Debug, fileTarget);
config.LoggingRules.Add(rule2);
// Step 5. Activate the configuration
LogManager.Configuration = config;
LogManager.ReconfigExistingLoggers();
}
MS Unit Test: use TestContext to get current TestName
1) insert Property TestContext into your TestClass - its filled by MSTest:
public TestContext TestContext { get; set; }
2) then use it in TestInitialize
[TestInitialize]
public void TestInitialize()
{
LOGGER.Info("Initialize Test {0} TestDir={1}", TestContext?.TestName, TestContext?.TestDir);
}
public TestContext TestContext { get; set; }
2) then use it in TestInitialize
[TestInitialize]
public void TestInitialize()
{
LOGGER.Info("Initialize Test {0} TestDir={1}", TestContext?.TestName, TestContext?.TestDir);
}
Wednesday, August 09, 2017
c# Lamda Ausdrücke, Action, Func, Anonyme Methoden (noname, keinName)
(x,y) => x*y; kurz für (x,y) => { return x*y; } kurz für keinName(x,y){return x*y;}
x => x*x; //nur ein Parameter - kann Klammern weglassen
() => 2*3; //kein Parameter - brauche Klammern
(int x, int y) => x*y; //typisierte parameter
aus:
http://www.lernmoment.de/csharp-programmieren/lambda-ausdruecke-erstellen/
// Deklariere ein Delegate
delegate int RechenOperation(int a, int b);
// verwende Lambda um dem delegate eine Anonyme Methode zuzuweisen.
RechenOperation multipliziere = (x, y) => x * y;
// rufe das delegate auf, um es auszuprobieren
int resultat = multipliziere(4, 5);
x => x*x; //nur ein Parameter - kann Klammern weglassen
() => 2*3; //kein Parameter - brauche Klammern
(int x, int y) => x*y; //typisierte parameter
aus:
http://www.lernmoment.de/csharp-programmieren/lambda-ausdruecke-erstellen/
// Deklariere ein Delegate
delegate int RechenOperation(int a, int b);
// verwende Lambda um dem delegate eine Anonyme Methode zuzuweisen.
RechenOperation multipliziere = (x, y) => x * y;
// rufe das delegate auf, um es auszuprobieren
int resultat = multipliziere(4, 5);
Action
var a1 = new Action(p1 => p1++);
var a2 = new Action((p1) => { p1++; });
var a2 = new Action
a1=a2
var a3 = new Action(() =>;
{
var x = 1;
x++;
}
);
Func
var f1 = new Func(() => { return 1; });
var f2 = new Func(() => 2);
Sunday, August 06, 2017
Android 6 SD Karte partitionieren
siehe https://www.droidwiki.org/wiki/HowTo_SD-Karte_Partitionieren
adb shell
sm list-disks adoptable
sm partition disk:179,128 mixed 75
wird dann zu 75% als externe, 25% interner Speicher formatiert
adb shell
sm list-disks adoptable
sm partition disk:179,128 mixed 75
wird dann zu 75% als externe, 25% interner Speicher formatiert
Subscribe to:
Posts (Atom)