|
If you have a Postgres database, I can recommend Postgrest.
modified 11-Nov-22 12:47pm.
|
|
|
|
|
Postgrest looks interesting. I need to find some time to play with that. Looks like it automates a lot of things I hate doing, lol.
|
|
|
|
|
Check out Heroku[^]. The free version includes max. 10000 row Postgres database.
|
|
|
|
|
Host it yourself ! I do this a lot using Net 6 - I have a SBC on my LAN running Linux with a database(postgres) the dotnet sdk and runtimes installed, publish your API to a folder in /var/www/ (can be anywhere) , create a systemd service file and put it in /etc/systemd/system folder (so you can control it) - job done. To start it - systemctl start myapi.service, if you want it started at boot time - systemctl enable myapi.service
Sample service file
[Unit]
Description=Pete Kane Commands API net core<br />
StartLimitIntervalSec=0
[Service]
ExecStart=/usr/bin/dotnet /var/www/CommandsAPI/CommandsAPI.dll
WorkingDirectory= /var/www/CommandsAPI/
User=pjk
Group=pjk
Restart=on-failure
SyslogIdentifier=Commands-API
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
modified 27-Jul-22 4:12am.
|
|
|
|
|
A very nice and helpful tip how simple it may be!
For someone with only .NET desktop experience, I'm today still staying away from the .NET back end stuff, and still a newbie. I stay still away on the old PHP solution way.
Something about which we often break our head:
"In the name of the Compiler, the Stack, and the Bug-Free Code. Amen."
(source unknown)
|
|
|
|
|
In my own (limited) experience, no question with the word "easy" in it should have the words "Azure" or "AWS" in the answer.
|
|
|
|
|
My preference would be web api in net6 + linux container + gcp kubernetes cluster with 1 minimal node like n1-standard-1. This would require a (free) local Docker Desktop on Win 10, and a free GCP subscription with 300 USD credit for 3 months
|
|
|
|
|
web api functions in Azure can be done in a few minutes. depends how complex the code need to be, but can write in browser, save, and is running.
Cost - running cost only if called, and even then talking 1000s per 1 penny
the 50$ free with account, I cant remember if that a 1 first year free things, or if have visual studio license comes with a 50$ per month with license.
if .net application - similar cost of running as Function App
|
|
|
|
|
|
I host my own
About 5 years ago I pooled together about £400 gbp, and bought a second hand Dell server that was only 2 years old from a local dealer.
The server was a 4 Node C6100 server, with each node/sled fully populated (8 cores and 24gb Ram + 3 1Tb drives), However, what I'm about to describe can be run on any bit of old PC hardware built within the last 10 years or so, as long as it has a CPU with virtualisation extensions added, which today is all Xeons, and most i5/i7 series.
Put a decent size hard drive in the machine, download the latest Ubuntu Server LTS version (Currently 22.04 as I write this [I personally am still on 20.04]), burn the ISO to a CD or a keychain, and boot and install the PC with it.
Go with the defaults, if you download the server version you should not get asked if you want a desktop or anything on it, if you do though... the answer is NO, you don't need a GUI or anything on this system, just an SSH server (Which you may also get asked if you want)
Once you have the base installed, then you first want to do an update:
apt update; apt upgrade
Just to make sure everything's up to date.
Following that, you want LXD installing, no point in repeating what others have written, so you you can find all you need to know here:
https://www.cyberciti.biz/faq/install-lxd-on-ubuntu-20-04-lts-using-apt/
For performance reasons on a single stand alone PC, you probably want the "snap" version, and when you init your default storage pool "btrfs" as the file system type, unless of course you want access from your host machine direct into the containers you create then your storage type wants to be "dir", the rest are for more specialist cases and require too much overhead to maintain.
Once you have your Server set up, and LXD installed and initialised, then your ready to rock and roll:
lxc launch ubuntu:20.04 myfirstcontainer
Will spin up your first container running ubuntu LTS 20.04 ready for you to "lxc exec <name> bash" into it and start adding users, software etc to it.
LXD/LXC containers running ubuntu, use something called cloud-init, which allows you to add provisioning steps directly to your containers at creation time, I've already created a profile script to add to LXD and you can grab a copy from github here:
LXD Profile to add to your LXD install, allowing the creation of lightweight DOTNET 6 containers when using "lxc launch"
You can add the profile to your LXD install as follows
cat dotnet.profile | lxc profile edit dotnet
Then use it to create auto provisioning containers using
lxc launch ubuntu:20.04 mysecondcontainer -p dotnet
If your NOT using a container image that uses cloud init, then you can use my alternate script that uses "LXC commands" at the ubuntu host command line to provision your container, you can grab a copy of those here:
Bash script to provision a standalone Linux container based on Debian, setting it up to run DOTNET 6 SDK and including the Midnight Commander file manager and text editor.
For managing the users in the containers and generating SSH keys that you can then use in PuttySSH on a windows machine, you can grab a copy of the scripts I use for those tasks here:
Provisioning Scripts that I use for managing containers running DOTNET 6 projects on LXD/LXC
NOTE: To use the ssh creation script you will need to install "putty-tools" from the Ubuntu package manager so that you can generate windows compatible PPK certs for use with Putty on Windows. If you use a different SSH tool set, then you'll need to alter the script to run something like "ssh-keygen" instead.
You can customise the profile and scripts to include any language runtimes you want. I work mostly with C# & .NET hence why mine are all DN6, but you can use this method & scripts to set-up python, node, go, flutter anything you want.
You could even create separate profiles for different language installs if your using cloud-init aware OS's, then it's a simple matter of just "-p blahprofile" as needed when you launch a new image.
I also have "Team City & Jenkins" installed on the container host, and with a lot of my projects I have a full CI/CD process that allows me to just check code in to my Git-Server (Which I also run locally on my own gear) , and the CI/CD process then tears down any old container running, builds a new one, builds the code, pushes the built code into the new container, then re-starts it.
Make no mistake here either, LXD/LXC containers are NOT Like docker images. These thinks look, feel and behave like full blown miniature VM's, they will acquire their own IP address from the host (You WILL have to do the extra work of manually creating a bridged network interface if you want them to use the same DHCP on your router as everything else does) and they will set up their own file system that you can run an SSH service on, and that appears as if it was a separate directly addressable server in your network.
Best part about it all... if you have an OLD pc (Doesn't have to be stupid powerful) that's sitting gathering dust, doing this should cost you nothing, but a bit of learning and setting up time.
I did an earlier video on my YouTube page, showing how to use the same sort of methods for setting up and running a DOTNET Core Blazor Server app, but that is a bit out of date now, you can watch it here if you want to however:
building a blazor app on LXC - YouTube
modified 28-Jul-22 10:41am.
|
|
|
|
|
It's apt update not apt install update same for upgrade
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
|
|
|
|
|
aye, so a minor keyboard slip occured... meh...
|
|
|
|
|
It was a minor obervation Pete
Life should not be a journey to the grave with the intention of arriving safely in a pretty and well-preserved body, but rather to skid in broadside in a cloud of smoke, thoroughly used up, totally worn out, and loudly proclaiming “Wow! What a Ride!" - Hunter S Thompson - RIP
|
|
|
|
|
Ya I know....
You just caught me on the back of dealing with some woke idiots on Quora
sa'll good.
|
|
|
|
|
|
Can we get some more info? "API" is a pretty wide generic term, meaning very little by itself
- What language are you looking to write it in?
- Scale? Lots of parts and pieces to this, but on a simple level, there's a big difference between serving up a few
thousand hits a day and a million.
- DB? Accessing SQL DB - SQL Server, Postgres, MySQL/Maria? Scope again - Select only, Insert, Upsert, Delete,
number of tables, linkages, etc?
-Instancing? Do you need Docker containers?
-Security? Need API key management?
Basically, what are you trying to do?
Given the last question, I found Azure to be a tad easier than AWS. For me, for proof-of-concept, I'd use a LAPP server to start. I'm partial to Postgres and most *nixes are set and forget. PHP/Postgres is good for prototyping data access. With a few tools, I could have a basic data API up and running in a few hours. Returning JSON, XML, or even an HTML block.
Major clouds can all handle scale. I use PHP for prototypes, but I generally know the magnitude of scale. Even unknown, I don't concern myself much with it. I always figure if it becomes an issue, it'll be making enough money to spend the time or cost to do something different.
|
|
|
|
|
For the prototype of my project, I am using DreamCompute from DreamHost. I pay under $40 per month.
I'm using Rust with the actix_web crate to build out the API, packaging it in a Docker container, and using Nginx for routing and reverse proxying. MySql is the DB.
So far, so good.
|
|
|
|
|
MS's Snip & Sketch's 'New' snip button changes location depending upon how big your window is if you have a snip in it. Their UI people should be fired.
And if you use AutoHotKey to change window transparencies, Snip & Sketch somehow captures the control key and jumps to pure transparent rather than gradually transitioning, like the old Snipping tool used to do.
The old Snipping tool would open up after you snipped something, with the snip in it. But if you use the 'Windows' + 'Shift' + 'S' to get a snip, afterwards the Snip & Sketch tool doesn't open up with the snip in it. And if you did have the Snip & Sketch window opened, the snip you took doesn't get placed in that window! It is only in the clipboard.
I'm muttering the word "Idiots!" under my breath a lot today.
|
|
|
|
|
Myself, I prefer that the snipping tool doesn't pop up after getting my image on the clipboard. Usually I am just getting a screen image that I am adding to a document or bug report. And if I do need to annotate it first, I would rather do that in Paint.net instead.
I find though that (in Win 10 at least) I do get the notification popup that my image was snipped - if I then click the popup, the snipping app is opened.
|
|
|
|
|
I have to say I prefer the new way: WIN+SHIFT+S copies to the clipboard, with a clickable notification that opens it in the snip tool.
That way, I can paste it directly into what I want - PaintShop Pro say, for pixelation - or use Snip to quickly highlight one bit for pasting into an email or website, or to save it as a file.
And for me, the "New" button doesn't seem to be moving at all no matter how large the window. I'm on Win 11 21H2 (OS Build 22000.795), and Snipping Tool 11.2205.10.0
[edit]
"... copies to the keyboard, with ..."?
Drink your Griff, you need it.
[/edit]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
OriginalGriff wrote: I'm on Win 11 21H2 Maybe that's the difference. I've got Win 10, and MS seems to have said it will never support this chipset on 11, and it doesn't have a TPM chip, so... It is a middle-class gaming laptop from five or six years ago that still kicks butt to all the old systems I had.OriginalGriff wrote: the "New" button doesn't seem to be moving at all Yay! they must have fired those UI people! On mine it actually moves from the top left of the screen to the bottom left. Effin' stupid!
|
|
|
|
|
I've been using Greenshot for a while, maybe check that out
|
|
|
|
|
Same.
What I really like, it is really easy to capture menus & tooltips that usually disappear when a form loses focus.
// TODO: Insert something here Top ten reasons why I'm lazy
1.
|
|
|
|
|
The old Snipping Tool can capture those things, you just set a delay and then after you click the New button, switch to your other window and open the menu that you want to capture, then it will grab the screen as it is after the delay.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
On top of all this idiocy, there's no way to create ovals or rectangles to highlight stuff.
|
|
|
|
|