Skip to content

Instantly share code, notes, and snippets.

View tasdikrahman's full-sized avatar
💭
Automate everything

Tasdik Rahman tasdikrahman

💭
Automate everything
View GitHub Profile
@tasdikrahman
tasdikrahman / irssi.md
Last active September 17, 2024 19:56
irssi cheatsheet
@tasdikrahman
tasdikrahman / python_tests_dir_structure.md
Last active September 15, 2024 16:13
Typical Directory structure for python tests

A Typical directory structure for running tests using unittest

Ref : stackoverflow

The best solution in my opinion is to use the unittest [command line interface][1] which will add the directory to the sys.path so you don't have to (done in the TestLoader class).

For example for a directory structure like this:

new_project

├── antigravity.py

@tasdikrahman
tasdikrahman / gomock.md
Created July 9, 2024 10:30 — forked from thiagozs/gomock.md
Tutorial gomock

08/16/17 by  Sergey Grebenshchikov

No Comments

This is a quick tutorial on how to test code using the GoMock mocking library and the standard library testing package testing.

GoMock is a mock framework for Go. It enjoys a somewhat official status as part of the github.com/golang organization, integrates well with the built-in testing package, and provides a flexible expectation API.

@tasdikrahman
tasdikrahman / ico.rst
Created February 3, 2016 15:14
Everything you ever wanted to know about ico's
@tasdikrahman
tasdikrahman / list.md
Created September 1, 2016 14:03
Big List of Compiler Writing and Language Designing Resources

List of various compiler resources

Notes

  • 🌠 represents a resource that has been fully read and approved
  • ★ represents a resource that has been skimmed and looks good
  • ☠ represents a resource that has been darkf approved.
  • No symbol represents a resource that I just threw up here (quanity over quality and all of that)
  • Hopefully all links will eventually move to 🌠 and/or ☠
  • The Interesting Reads section isn't specifically for compiler development, but might still be interesting to read for a compiler writer
@tasdikrahman
tasdikrahman / .sqliterc
Created November 3, 2015 12:59
sqlite3 rc file for showing the columns and mode in order. Place it in ~/
.header on
.mode column
@tasdikrahman
tasdikrahman / go-stdlib-interface-selected.md
Created July 31, 2023 15:09 — forked from asukakenji/go-stdlib-interface-selected.md
Go (Golang) Standard Library Interfaces (Selected)

Go (Golang) Standard Library Interfaces (Selected)

This is not an exhaustive list of all interfaces in Go's standard library. I only list those I think are important. Interfaces defined in frequently used packages (like io, fmt) are included. Interfaces that have significant importance are also included.

All of the following information is based on go version go1.8.3 darwin/amd64.

@tasdikrahman
tasdikrahman / haproxy-allow-whitelisted-IPs.cfg
Created May 5, 2019 16:05
HAproxy config (/etc/haproxy/haproxy.cfg) for kingsly to allow only whitelisted IP's for a backend.
frontend kingsly-frontend
...
...
acl ALLOW_SRC src -f /etc/haproxy/include/allow-ips.lst
http-request deny if !ALLOW_SRC
...
...
default_backend kingsly
@tasdikrahman
tasdikrahman / traefik-daemonet.yaml
Last active February 8, 2022 08:50
traefik daemonset config for ingress controller
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: traefik-ingress-controller
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: traefik-ingress-controller
subjects:
diff --git a/app/jobs/check_certificate_job.rb b/app/jobs/check_certificate_job.rb
index 93fb16b..76f995b 100644
+++ b/app/jobs/check_certificate_job.rb
--- a/app/jobs/check_certificate_job.rb
@@ -10,7 +10,7 @@ class CheckCertificateJob < ApplicationJob
Domain.all.each do |domain|
if domain.certificate_expiring?
Rails.logger.info("#{domain.fqdn} is expiring within the buffer period")
+ if (Figaro.env.send_expiry_notifications_to_slack == 'true') && !Figaro.env.slack_webhook_url.empty?
- if (Figaro.env.send_expiry_notifications_to_slack == true) && !Figaro.env.slack_webhook_url.empty?