0xdstn hello projects wiki reading art feeds
..

📘 Development notes

This page contains any notes I find useful related to software/web development.

  1. Snippets
  2. Tricks
  3. Tools

Snippets

Display all PHP errors

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

PHP Web Server

php -S 0.0.0.0:8000

Python 2 Web Server

python -m SimpleHTTPServer

Python 3 Web Server

python -m http.server

Create an uppercase GUID in Powershell

[guid]::NewGuid().toString().ToUpper()

Entity Framework

Add migration

dotnet ef migrations add MigrationName

Run migrations

dotnet ef database update

Rollback migration

dotnet ef database update PreviousMigrationName

Rollback all migrations

dotnet ef database update 0

Remove most recent migration

dotnet ef migrations remove

Tricks

Github web editor

You can edit a github repository by pressing . while viewing it. This will open up a VS Code web editor with the source of the repository.

Raspberry pi setup

Enable ssh

In /boot create a blank file called ssh

Enable wifi

In /boot create a file called wpa_supplicant.conf with the following:

Set up Apache + PHP

sudo apt update
sudo apt install apache2
sudo usermod -a -G www-data [USERNAME]
sudo chown -R -f www-data:www-data /var/www/html
sudo chmod -R 770 /var/www/html
sudo apt install php

Wttr.in

View the weather forecast via the command line

curl "wttr.in/Spokane?0"

ssh config

You can configure SSH servers in your ~/.ssh/config file, to set up easy to remember aliases for complex SSH configurations, for example:

Host tilde
HostName tilde.town
User dustin
IdentityFile "~/id_rsa"

You can also set a port or an IP for the hostname:

Host srv
HostName 123.456.0.1
User dustin
Port 1234

You can then SSH using the alias, such as these commands for those two examples above:

ssh tilde
ssh srv

Tools

CLI

Web

👋 Hey! Thanks for reading! If you have any comments or questions about this post, or anything else, I'd love to chat! You can find the best way to contact me on my hello page or send me an email.