How to move your project from Linux/Mac to a Linux server using SCP

This is purely for the comparison. My recent post was about the same thing but on Windows. Nasty business. And here is a guide for Linux/Mac – it is so much easier.

The difference is that here I use SCP, and for Windows I used SFTP. That is because even after generating the keys with PuTTYgen I could not figure out how to “install” them into PuTTY to use a command pscp -scp (the PuTTY scp) in the Command Prompt. That and the fact that my teammate was more comfortable with GUIs, so I picked the first thing that worked.

Read More »

How to move your project from Windows to a Linux server using SFTP

I abandoned Windows years ago. And I don’t remember the exact moment, but I believe it was something akin to localization issues (my Windows was in Russian).

But in my line of work I deal with different developers on different systems, and lately I have had a situation, where one of my teammates had to use SFTP on Windows… If SFTP on Linux/Mac is a very easy one and done thing, on Windows – not so much.

So I figured out a solution for them.

Disclaimer: On the screenshots the GUIs of the programs are in Russian, but in my text instructions I go through everything in great detail. I also wrote this guide in Russian and translated it with Google Translate, because I feel so lazy right now – I slept like 10 hours without interruption and I feel like I hit gym yesterday (but I actually hit McDonalds).

Read More »

www not working

Before you spend hours of working on Nginx config etc., check your domain’s DNS records.

You need to have a record resembling this:

Type: CNAME

Hostname/Name: http://www.your.website

Value: your.website

TTL (seconds): 3600

And in Nginx you need to capture http://www.your.website (port 80) and redirect it to https://your.website (port 443). Something like this:

server {
    listen 80;
    
    server_name www.your.website
    return 301 https://your.website$request_uri;
}

[Note] [Lifestyle] FireFox on Linux + Django + Nginx = 499 ERROR omfg

I spent 6 hours today in Nginx configurations and logs, I learnt so much about Nginx and devops process. And in the end it was all because FireFox browser (I use desktop Ubuntu on my laptop) refused to connect to the server and get the sweet HTML pages I tried to serve it.

In particular, when I renounced attempts to serve HTML pages with explicitly stated location tags and launched my good old trusted Django and it STILL didn’t work (I got 499/403 in the access.log and 404 in the browser), I came to thinking something evil is going on here. It was an unexpected, and a bad one.

The moment I opened it in Google Chrome and it worked, dudes, if I was standing, I would fall that moment on my butt.

I immediately wrote to my Python friends "screw web, I will do webcam now". But, it was a rushed thought I soon gave up. Thankfully, I did not write that to my boss.

[Note] ‘ChatConsumer’ has no attribute ‘as_asgi’ – Sloppy development

Following Channels’ docs I encountered yet another error the solution to what was not obvious right off the bat.

Ditch Channels.

The End.

This was my original post in October 2020 and I stand by it.

You can make your project work with Google Firebase - it handles signals well enough. Yes it is primarily used by mobile developers, but overall it is fine for web too.

I spent trying to install Django Channels on my local Linux 18.04, and I kind of made it work, but then I had to deploy it... And as a professional backender you don't want to let people down.

I decided to try Channels because my Python-related friends talked about it. But days into the trouble I asked my friend about a certain step and he asked me in return "oh so [you use it because] they fixed Channels since two years ago?". I as like ??????????????????. So that moment I ditched it. Too much time wasted, but I like the result I achieved with Firebase.

What I am saying - Firebase is fast and universal. In a matter of days I managed to make and deploy an internal Customer Support chat service that connected mobile app users and a support from the web.</p>

I will be writing a new series on Django + Firebase, and this post is pretty much a short introduction.