- Create your bot with botfather
- Make you bot an admin of your channel
Go to Telegram web and open a channel, get the ID from -[channel id] from hash in the path
https://web.telegram.org/k/#-9999999999999
| # Make zsh start INSTANTLY with this one weird trick. | |
| # | |
| # https://asciinema.org/a/274255 | |
| # | |
| # HOW TO USE | |
| # | |
| # 1. Download this script. | |
| # | |
| # curl -fsSL -o ~/instant-zsh.zsh https://gist.github.com/romkatv/8b318a610dc302bdbe1487bb1847ad99/raw | |
| # |
| def sendTelegram(message) { | |
| def encodedMessage = URLEncoder.encode(message, "UTF-8") | |
| withCredentials([string(credentialsId: 'telegramToken', variable: 'TOKEN'), | |
| string(credentialsId: 'telegramChatId', variable: 'CHAT_ID')]) { | |
| response = httpRequest (consoleLogResponseBody: true, | |
| contentType: 'APPLICATION_JSON', | |
| httpMode: 'GET', | |
| url: "https://api.telegram.org/bot$TOKEN/sendMessage?text=$encodedMessage&chat_id=$CHAT_ID&disable_web_page_preview=true", |
| version: '3.2' | |
| services: | |
| collectd: | |
| image: fr3nd/collectd | |
| privileged: true | |
| network_mode: host | |
| volumes: | |
| - /proc:/mnt/proc:ro | |
| - ./collectd.conf:/etc/collectd/collectd.conf |
| import csv | |
| import logging | |
| import gevent | |
| from psycopg2 import ( | |
| connect, | |
| sql, | |
| ) | |
| from django.conf import ( |
| from fabric.api import env, run as fabric_run | |
| from fabric.contrib.project import rsync_project | |
| env.app_path = '/home/backend' | |
| env.user = 'circle' | |
| env.use_ssh_config = True | |
| env.disable_knodwn_hosts = True | |
| env.colorize_errors = True |
| #!groovy | |
| // I suggest you to add those functions as Shared Library https://jenkins.io/doc/book/pipeline/shared-libraries/ | |
| @Library('your-shared-lib') _ | |
| pipeline { | |
| stages { | |
| //.. | |
| stage('Run Unit Tests') { | |
| steps { |
Custom format for displaying bytes as kb, mb, gb or tb.
Response to a few places on the internet: https://productforums.google.com/forum/#!topic/docs/x_T_N-yRUYg And here: https://stackoverflow.com/questions/1533811/how-can-i-format-bytes-a-cell-in-excel-as-kb-mb-gb-etc
Here is one that I have been using:
[<1000000]0.00," KB";[<1000000000]0.00,," MB";0.00,,," GB"
This is how to use the Black Python code formatter in VS Code.
Black itself requires Python 3.6 to run, but few of our projects are on that version. The VS Code plugin conveniently lets you run black from its own virtualenv.
I had to give a specific version of black this morning. I didn't yesterday. Don't specify the version unless it makes you (and if you do, give the current version, not the one from this doc).
$ cd ~/Envs