Skip to content

Instantly share code, notes, and snippets.

View MichalSkoula's full-sized avatar
:shipit:

Michal Skoula MichalSkoula

:shipit:
View GitHub Profile
@MichalSkoula
MichalSkoula / gist:63968a55d933a58e59ac61194ffa9844
Created March 21, 2023 22:05
dotnet publish: how to copy file to publish folder (not output, but publish)
<ItemGroup>
<Content Include="file.txt" CopyToPublishDirectory="Always" />
</ItemGroup>
this is not available through GUI
@MichalSkoula
MichalSkoula / mbstrem-extract-maribackup-restore
Last active August 5, 2023 13:58
extract mbstream backup using mariadb's mbstream utility + restore database files
# use integrated docker terminal or run bash like this:
docker exec -it CONTAINERID /bin/bash
# unzip and then use mbstream utility to extract data
cd /var/www/html/dbbackup/;
gunzip -c DB.gz | mbstream -x;
# restore db
cd /var/lib/mysql;
rm -r *;
winget upgrade (optional)
winget upgrade -h --all
@MichalSkoula
MichalSkoula / mysql-import
Last active May 6, 2022 13:05
docker mysql import db
mysql -uroot -p --default-character-set=utf8
(enter password)
use "database-name";
source /var/www/html/db.sql;
@MichalSkoula
MichalSkoula / from_pc_to_arduino_serial.ino
Created September 6, 2019 21:33
arduino reads serial input from the pc
int incomingByte = 0; // for incoming serial data
const int ledPinRed = 2; // the number of the LED pin
const int ledPinGreen = 3; // the number of the LED pin
const int ledPinYellow = 4;
const int ledPinBlue = 5;
void setup() {
Serial.begin(9600); // opens serial port, sets data rate to 9600 bps
pinMode(ledPinRed, OUTPUT);
pinMode(ledPinGreen, OUTPUT);
@MichalSkoula
MichalSkoula / teplomer.ino
Created September 5, 2019 23:00
Simple Arduino code - LM75A thermometer + OLED + Arduino NANO
#include <U8g2lib.h>
#include <LM75A.h>
// Create display instance
U8G2_SSD1306_128X64_NONAME_1_HW_I2C u8g2(U8G2_R0);
// Create I2C LM75A instance
LM75A lm75a_sensor(false, false, false);
// temperature variable