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 / 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 / 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 / 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
@widnyana
widnyana / install-comodo-ssl-cert-for-nginx.rst
Created August 28, 2018 00:40 — forked from bradmontgomery/install-comodo-ssl-cert-for-nginx.rst
Steps to install a Comodo PositiveSSL certificate with Nginx.

Setting up a SSL Cert from Comodo

I use Namecheap.com as a registrar, and they resale SSL Certs from a number of other companies, including Comodo.

These are the steps I went through to set up an SSL cert.

Purchase the cert

@widnyana
widnyana / sgdbot.py
Created August 16, 2017 19:51 — forked from dkgeorge/sgdbot.py
Stop loss/Start gain dialog interactive bot for goxtool Mt.Gox trading bot framework
"""
a simple stop loss/start gain bot
adjust STOP_PRICE/START_PRICE and STOP_VOLUME/START_VOLUME to your needs.
to reset orders during runtime, press (s) for a new stop order and (g) for a new start gain
The file can be reloaded after editing without restarting goxtool by simply pressing the (l) key.
"""
# Using the global statement
# pylint: disable=W0603
# No exception type(s) specified
# pylint: disable=W0702
@widnyana
widnyana / Documentation.md
Created March 17, 2017 13:51 — forked from KartikTalwar/Documentation.md
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@widnyana
widnyana / gist:fda560fe943f187b7d2dee30473bb5d6
Created January 30, 2017 15:56 — forked from zxvdr/gist:5624054
RPC tracing for Golang (ala Dapper)
diff --git a/client.go b/client.go
index 4b0c9c3..8ac98e4 100644
--- a/client.go
+++ b/client.go
@@ -32,6 +32,7 @@ type Call struct {
Reply interface{} // The reply from the function (*struct).
Error error // After completion, the error status.
Done chan *Call // Strobes when call is complete.
+ Trace uint32 // unique id used for tracing
}
@widnyana
widnyana / .golang-example-gitlab-ci.yml
Created October 10, 2016 09:48 — forked from mikeatlas/.golang-example-gitlab-ci.yml
Example Go GitLab CI setup (no root/sudo required)
# See docs/examples
# http://doc.gitlab.com/ce/ci/quick_start/README.html
# http://doc.gitlab.com/ce/ci/yaml/README.html
# GitLab CI template for Go tests. Note this installs
# a new working copy of Go in a non-standard path such
# that sudo/root is not needed for the install stage.
# note that this particular install-environment stage
# is overly verbose in order to debug anything tricky