TGTGInsighttelegram intelligenceLIVE / telegram public index
← Python Заметки

TGINSIGHT SIMILAR POSTS

Најди сличен содржај

Изворен канал @pythonotes · Post #281 · 18 авг.

Что-то вы гоните насчет "привычного вида формата 755 и 644". Я вот вообще не понял что это!😳 Действительно, что означают цифры которые мы получили в прошлом посте? Это кодировка, заключающая в себе режимы доступа к файлу. Подробней можно почитать в статье про chmod. Там можно увидеть альтернативное обозначение того же самого с помощью символов r w x, что значит чтение, запись, исполнение. Чтобы преобразовать восьмеричное число в такое обозначение в Python есть готовая функция >>> stat.filemode(0o755) '?rwxr-xr-x' Мы видим 3 группы по 3 символа, дающие 3 типа доступа для 3 типов юзеров. А что за знак вопроса в начале? Давайте передадим в эту функцию необрезанное значение от os.stat >>> stat.filemode(os.stat(path).st_mode) 'drwxr-xr-x' Это данные, которые мы безжалостно обрезали в прошлый раз😼 Первый символ обозначает тип объекта. Это может быть файл (-), директория (d) или симлинк (l). Вот простая схема данной кодировки [1][3][3][3] │ │ │ │ │ │ │ └──> Others Permissions │ │ └─────> Group Permissions │ └────────> Owner Permissions └───────────> File Type (разверните экран если вы с телефона) Если вы попробуете получить пермишены для симлинка то получите пермишены для файла >>> path = '.venv/bin/python3' >>> stat.filemode(os.stat(path).st_mode) '-rwxr-xr-x' Чтобы получить свойства именно симлинка, нужно это явно указать >>> stat.filemode(os.stat(path, follow_symlinks=False).st_mode) 'lrwxrwxrwx' #tricks#basic

Резултати

Пронајдени 14 слични објави

Пребарај: #downtime

当前筛选 #downtime清除筛选
Luckydonalds Bots: Development/Status

@luckydonaldsbots · Post #162 · 21.10.2018 г., 13:20

Apperently also @anonymize_bot is affected. Currently looking into the issue. Update: It should now be back and running, but telegram reports about two thousand updates being still unprocessed, but that is decreasing. It will recover soon, bear with me, it works as fast as telegram allows it to. Update: @anonymize_bot It is now back to normal. #Anonymize#downtime'

Luckydonalds Bots: Development/Status

@luckydonaldsbots · Post #108 · 29.11.2017 г., 11:39

Expected downtime: Today, 13:00 UTC. Duration 1h. Delayed, see post below. Because my current server isn't powerful enough, especially regarding Disk IO speed, I will move part of the infrastructure to a new server with SSD storage. This means I have to take down the databases, and copy them over. I'll try to keep the bots running which doesn't need a database, like @ponbot, @anonymize_bot, @HeyAdminBot, @moustache_bot, etc. #expected_downtime#downtime

Luckydonalds Bots: Development/Status

@luckydonaldsbots · Post #251 · 04.07.2020 г., 14:51

Maintenance: Moving @BanWarnBot to the new server. Okey going through the same procedure for @BanWarnBot now, hopefully without the database breaking this time. Turning the bot off for moving the database, so any /warns send in the meantime shouldn't get lost. As soon as it's on the new server it should pick up those, and carry out the needed actions. I'll take @BanWarnBot down in 10 minutes. Other bots should not be affected. #maintenance#downtime#BanWarnBot

Luckydonalds Bots: Development/Status

@luckydonaldsbots · Post #188 · 24.02.2019 г., 01:05

If you docker refuses to start and sudo service docker status is showing logs like this: Feb 24 01:30:06 hostname dockerd[19544]: time="2019-02-24T01:30:06.718823877+01:00" level=error msg="stream copy error: reading from a closed fifo" It might be that /var/run/docker.sock is a mount in one of your containers. Therefore if that doesn't exist - and only shortly - it will be created as a folder, thus making it impossible for docker to start. Fix it with sudo rmdir /var/run/docker.sock, and sudo service docker start. #TechnicalDetails#downtime#in_progress

12
ПретходнаСтраница 1 од 2Следна