Skip to content

Instantly share code, notes, and snippets.

@freix1
freix1 / wireguard.md
Last active November 10, 2022 13:55
[Wireguard] with PiVPN

Configuration

  • IP: 192.168.1.200
  • Port: 51820

Users

Add new client profile

pivpn add

Important: For each user that wants to use Wireguard a distinct client profile should be created!

@freix1
freix1 / prisma.md
Last active June 27, 2022 09:13
[Prisma]

Installation

npm install prisma --save-dev
npm install @prisma/client --save-dev

Push schema to the database

Schema file schema.prisma should either be in the default directory ./prisma/ or provided with the --schema option or set as prisma.schema in the package.json file.

npx prisma db push
@freix1
freix1 / ef-core.md
Last active June 23, 2022 22:24
[Entity Framework Core] #CSharp

Installation

macOS

dotnet tool install --global dotnet-ef
export PATH="$PATH:$HOME/.dotnet/tools"

Migrations

Add a new migration

.NET CLI

@freix1
freix1 / macOS.md
Last active June 7, 2022 10:48
[Mac]

Terminal

Get own IP address

en0 = default for wireless adapter, en1 = default for ethernet

ipconfig getifaddr en0
@freix1
freix1 / docker.md
Last active November 10, 2022 15:53
[Docker]

Installation on Debian (+ Raspbian)

Source: https://docs.docker.com/engine/install/debian/

curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh

Create container via docker-compose

Create container for a MSSQL Server instance

@freix1
freix1 / programming_general.md
Created May 2, 2022 20:02
[General Programming]

Abstract Class vs. Interface

An abstract class allows you to create functionality that subclasses can implement or override. An interface only allows you to define functionality, not implement it. And whereas a class can extend only one abstract class, it can take advantage of multiple interfaces.

@freix1
freix1 / threads.md
Last active February 1, 2022 14:54
[Threads]

Daemon Threads

When Daemon Threads are useful

In a big project, some threads are there to do some background task such as sending data, performing periodic garbage collection etc. It can be done by non-daemon thread. But if non-daemon thread is used, the main thread has to keep track of them manually. However, using daemon thread the main thread can completely forget about this task and this task will either complete or be killed when main thread exits.

@freix1
freix1 / cmd.md
Last active May 18, 2023 17:52
[Windows] #Windows #Microsoft #Edge

Shutdown

Command Description
shutdown /s Shut down the computer
shutdown /r Restart the computer
shutdown /l Log off from computer

Clear local DNS cache

ipconfig /flushdns
@freix1
freix1 / commands.md
Last active January 30, 2022 09:06
[Screen] #Unix

Installation

The screen package is pre-installed on most Linux distros nowadays. You can check if it is installed on your system by typing:

screen --version

If it is not installed it can be installed via:

sudo apt install screen
@freix1
freix1 / commands.md
Last active January 20, 2022 19:40
[Pi-hole] #Python #RaspberryPi #Unix

Update

pihole -up

Reset password

pihole -a -p