Taari Scribbles

Feb 23, 2023

Janch

Do you find it difficult to keep track of all the potential issues that could affect your software product? It's easy to get overwhelmed by the sheer number of things that could go wrong, from web service outages to low disk space and excessive error logging.

Janch is a powerful yet lightweight tool that can help you monitor your software product and ensure that everything is running smoothly. With just a few entries in a YAML file, you can set up your targets and let the tool do the rest. It reads and interprets the YAML file, giving you a clear and concise status report on all your targets.

Example YAML config

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
command-example:
  gather:
    type: command
    command_str: python --version
  inspect:
    result: ^Python 3\.(.*)$

grep-example:
  gather:
    type: grep
    filepath: test.env
    search: '='
  inspect:
    result: (.*)=(.*)
    line_count: 1

webservice-example:
  gather:
    type: http
    url: http://www.example.com
  inspect:
    status: 200

Example Output

item                            type    field           expected                        actual                          match error
grep-example                    grep    result          (.*)=(.*)                       Hello=world                     True  False
grep-example                    grep    line_count      1                               1                               True  False
grep-example                    grep    error           NOERROR                         NOERROR                         True  False
command-example                 command result          ^Python 3\.(.*)$                Python 3.8.2                    True  False
command-example                 command error           NOERROR                         NOERROR                         True  False
webservice-example              http    status          200                             200                             True  False
webservice-example              http    error           NOERROR                         NOERROR                         True  False

Try it

Visit the Github Page

Oct 14, 2020

Happy Dashain in Turtle

Draw this Happy Dashain and Tihar Spiral using the code that follows

Happy Dashain and Tihar Spiral

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import turtle as t

# This gives more control of speed t.tracer(refreshes, delay)
t.tracer(10,1)
t.write("",font=("Arial", 1, "normal"))

t.Screen().bgcolor("black")

N = 15
angle = 45
text="HAPPYDASHAINTIHAR"
length=len(text)
colors=["violet","indigo","blue","green","yellow","orange","red"]

turtles = []

for position in range(N):
  look_at = 360/N*position
  color_position=colors[position%len(colors)]
  new = t.Turtle()
  new.setheading(look_at)
  new.color(color_position)
  new.penup()

  turtles.append(new)

for radius in range(30):
  character=text[radius % length]

  for my in turtles:
    my.circle(radius**1.9, angle)
    my.write(character,font=("Arial", radius, "normal"))