Skip to content

Instantly share code, notes, and snippets.

View widnyana's full-sized avatar
🤘
I'm looking for new challenges :)

wid widnyana

🤘
I'm looking for new challenges :)
View GitHub Profile
@widnyana
widnyana / config.yml
Created February 4, 2025 13:40
Blocky config
upstreams:
init:
# Configure startup behavior.
# accepted: blocking, failOnError, fast
# default: blocking
strategy: fast
groups:
# these external DNS resolvers will be used. Blocky picks 2 random resolvers from the list for each query
# format for resolver: [net:]host:[port][/path]. net could be empty (default, shortcut for tcp+udp), tcp+udp, tcp, udp, tcp-tls or https (DoH). If port is empty, default port will be used (53 for udp and tcp, 853 for tcp-tls, 443 for https (Doh))
# this configuration is mandatory, please define at least one external DNS resolver
AWS: https://<bucket-name>.s3.<region>.amazonaws.com/<object-key>
GCP: https://storage.googleapis.com/<bucket-name>/<object-name>
Azure: https://<account-name>.blob.core.windows.net/<container-name>/<object-name>
Alicloud: https://<bucket-name>.<region>.aliyuncs.com/<object-name>
IBM Cloud: https://<bucket-name>.<region>.cloud-object-storage.appdomain.cloud/<object-name>
Oracle Cloud: https://<bucket-name>.<region>.cloud-object-storage.appdomain.cloud/<object-name>
@widnyana
widnyana / install-go.sh
Last active October 16, 2023 06:46
Bash script to install golang compiler
#!/bin/bash
# shellcheck disable=SC2016
set -ex
VERSION="${GO_VERSION:-"1.20.6"}"
GOROOT="/build/.go"
GOPATH="/build/.go/gopath"
OS="$(uname -s)"
function checkBankBin(cardNumber){
var bankBinsSupport = ['970432','970416','9704163','970424','970418','970448','970426','970441','970403','970436','686868','970437','970429','550796','453618','970415','970443','970422','970454','970424'];
var result = new Object();
result['support'] = false;
result['cardNumberFormat'] = '#### #### #### ####'
result['cardNumberLength'] = result['cardNumberFormat'].replace(/ /g,'').length;
if(cardNumber) {
cardNumber = cardNumber.replace(/ /g,'');
@widnyana
widnyana / WireGuard-site-to-site.md
Created March 23, 2021 11:09
Accessing a subnet that is behind a WireGuard client using a site-to-site setup

WireGuard Site-to-Site

Accessing a subnet that is behind a WireGuard client using a site-to-site setup

Problem Summary

We want to access a local subnet remotely, but it is behind a NAT firewall and we can't setup port forwarding. Outgoing connections work, but all incoming connections get DROPPED by the ISP's routing policy.

Solution Summary

@widnyana
widnyana / nokia-router-cfg-tool.py
Created February 25, 2021 08:35 — forked from thedroidgeek/nokia-router-cfg-tool.py
Nokia/Alcatel-Lucent router backup configuration tool
#!/usr/bin/env python3
#
# Nokia/Alcatel-Lucent router backup configuration tool
#
# Features:
# - Unpack/repack .cfg files generated from the backup and restore functionnality
# in order to modify the full router configuration
# - Decrypt/encrypt the passwords/secret values present in the configuration
@widnyana
widnyana / grafana-value.yml
Last active March 9, 2020 08:50
kong-monitoring
persistence:
enabled: true
datasources:
datasources.yaml:
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
url: http://prometheus-server
access: proxy
@widnyana
widnyana / logger.go
Last active November 15, 2019 12:15
logrus log to file
package becak
import (
"fmt"
"github.com/sirupsen/logrus"
"os"
)
type x struct {
outfile *os.File
@widnyana
widnyana / tuned.conf
Created November 8, 2019 15:09
splunk tuned adm configuration
#
# tuned configuration
#
[main]
summary=Broadly applicable to Splunk server tuning that provides excellent performance across a variety of common server workloads
[cpu]
governor=performance
energy_perf_bias=performance
@widnyana
widnyana / celery_tasks_error_handling.py
Created May 31, 2019 07:05 — forked from darklow/celery_tasks_error_handling.py
Celery tasks error handling example
from celery import Task
from celery.task import task
from my_app.models import FailedTask
from django.db import models
@task(base=LogErrorsTask)
def some task():
return result
class LogErrorsTask(Task):