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
Monday, March 04, 2024
Autostart Folder usw
Sunday, January 21, 2024
windows wsl (linux auf windows)
power shell starten
wsl installieren:
wsl --install
wsl version abrufen
wsl --version
verfügbare linux distributionen auflisten
wsl --list
starten der default installation
wsl --d
starten iener bestimmten distribution
wsl --d Ubuntu
Monday, January 08, 2024
.net auf rasperry pi
.net framework auf rasperry installieren
https://learn.microsoft.com/de-de/dotnet/iot/deployment
neues console projekt: dotnet new consolestarten: dotnet run
Visual Studio Code installieren:sudo apt install code
maria db
rasperry:
sudo apt install mariadb-server
sudo mysql_secure_installation
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Port unkommentieren, d.h. # entfernen
CREATE USER test'@'localhost' IDENTIFIED BY 'Test123!';
GRANT ALL PRIVILEGES ON neueDatenbank . * TO 'neuerUser'@'localhost';
GRANT ALL PRIVILEGES ON *. * TO 'neuerUser'@'localhost';
Sunday, December 10, 2023
ssrs report builder
funktioniert nur mit eigener Datenquelle, nach veröffentlich umstellen auf shared datasource
ssrs Reporting Services Cannot read next row
Erhalte diesen Fehler durch die Where Klausel: where C>GetDate()-@Tage
umgestellt auf where C>@Von funktioniert
FEHLER SQL GESAMT:
declare @tage as int=100; declare @Anz as int =0
select errlevel,namespace as nspace,title,msg,count(*) as anz from tLog
where C>GetDate()-@Tage
group by errlevel, namespace, title,msg
having count(*)>@Anz
order by errlevel,count(*) desc
Monday, May 22, 2023
Sql Update Delete JOIN
UPDATE P
SET P.UnitPrice = P.UnitPrice * 1.1
FROM Product P
JOIN OrderItem I ON P.Id = I.ProductId
delete a From tAdressen a join cte as c on
Wednesday, March 01, 2023
sql server no delete - kein löschen
das Löschen von Datensätzen in einer tabelle kann mittels dieses triggers verhindert werden:
to prevent sql server to delete records of a table use this trigger:
create TRIGGER dbo.Test1Delete
ON dbo.Test1
INSTEAD OF DELETE
AS
BEGIN
-- SET NOCOUNT ON added to prevent extra result sets from
-- interfering with SELECT statements.
SET NOCOUNT ON;
print 'no delete !'
END
Monday, January 16, 2023
oracle add user
create user ztest identified by 123;
GRANT CREATE SESSION TO ztest2; -- so can log in
GRANT CREATE Table, create VIEW, CREATE PROCEDURE, CREATE SEQUENCE, CREATE TRIGGER to ztest2;
ALTER USER ztest2 QUOTA 100M ON DMCS;
Wednesday, November 09, 2022
sql server geolocation (geography typ)
CREATE TABLE [dbo].[tGeoTest](
[Id] [int] IDENTITY(1,1) NOT NULL,
[name] [nchar](200) NULL,
[geo] [geography] NULL
) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]
insert into tGeoTest (name,geo) values ('Eiffelturm',geography::Point(48.858260200000004, 2.2944990543196795 , 4326))
insert into tGeoTest (name,geo) values ('Stefansturm',geography::Point(48.209133, 16.3724786 , 4326))
DECLARE @geo1 geography=(select geo from tGeoTest where id=1)
DECLARE @geo2 geography=(select geo from tGeoTest where id=2)
select @geo1.STDistance(@geo2)/1000 as Distanz
Thursday, November 03, 2022
sql server database diagramm creation error
Error:
Cannot execute as the database principal because the principal “dbo” does not exist, this type of principal cannot be impersonated, or you do not have permission.
Solution: Unter Db Eigenschaften, Files einen Owner eintragen siehe:
Thursday, August 25, 2022
tailscale vpn
rasperry pi: https://tailscale.com/download/linux/rpi curl -fsSL https://tailscale.com/install.sh | sh
Thursday, April 14, 2022
esp 8266 erste Schritte
Unterschied esp32 und esp8266: esp32 ist leistungsstärker
GitHub - esp8266/Arduino: ESP8266 core for Arduino
wichtig:
1) Arduino IDE für Kommunikation mit ESP vorbereiten:
Datei/Voreinstellungen/Zusätzliche Bordevrwalter Urls: https://arduino.esp8266.com/stable/package_esp8266com_index.json
https://wolles-elektronikkiste.de/esp32-mit-arduino-code-programmieren
WeMOS Mega
https://www.fambach.net/mega-wifi/
Dipschalter Belegung
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | |
| ATMega <->ESP | An | An | Aus | Aus | Aus | Aus | Aus |
| USB <-> ATMega | Aus | Aus | An | An | Aus | Aus | Aus |
| USB <-> ESP Firmware | Aus | Aus | Aus | Aus | An | An | An |
| USB <-> ESP Kom. | Aus | Aus | Aus | Aus | An | An | Aus |
| Keine Verbindungen | Aus | Aus | Aus | Aus | Aus | Aus | Aus |
Monday, April 04, 2022
lock workstation by cmd / windows sperren aus der shell
https://www.howtogeek.com/686575/how-to-lock-your-windows-10-pc-using-command-prompt/
Rundll32.exe user32.dll,LockWorkStation
Wednesday, March 16, 2022
Monday, March 07, 2022
ExecuteNonQuery
using (var con = new SqlConnection(Data.ConStr))
{
con.Open();
var com = new SqlCommand("spStueckelisteLagerstand", con);
com.CommandType = CommandType.StoredProcedure;
var sqlFremdquelle = com.Parameters.Add("@myParam", SqlDbType.Int);
int anz = 0;
anz=com.ExecuteNonQuery();
Friday, February 11, 2022
regex more groups / reg-ex mehrere gruppen
(.*?)(\[.*?\]) findet in
meine [version] und mein [key] bla [key2] was
3 matches mit jeweils 2 gruppen
testen: https://regex101.com/r/4el4Oq/1
Saturday, December 04, 2021
Monday, November 22, 2021
remote powershell session: Enter-PSSession -ComputerName myhost -Credential $cred
$cred=Get-Credential
Enter-PSSession -ComputerName myhost -Credential $cred