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 / 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):
@widnyana
widnyana / keybase.md
Created December 23, 2018 15:42
keybase.io

Keybase proof

I hereby claim:

  • I am widnyana on github.
  • I am pwidnyana (https://keybase.io/pwidnyana) on keybase.
  • I have a public key ASD0lunuMfEaHpj6rOBmjSid4yKGQalGUncrdPkjNqN1Tgo

To claim this, I am signing this object:

@widnyana
widnyana / libvips-installer.sh
Created August 29, 2018 06:19 — forked from h6ah4i/libvips-installer.sh
libvips 8.5.6 cross-platform simple installer script (supports ~~OSX, Debian, Ubuntu, CentOS, Fedora,~~ Amazon Linux)
#!/bin/sh
#
# Orinally made by Lovell Fuller for sharp
# https://github.com/lovell/sharp
#
# Ensures libvips is installed and attempts to install it if not
# Currently supports:
# * Mac OS