Skip to content

Instantly share code, notes, and snippets.

View widnyana's full-sized avatar
🤘
available for hire

wid widnyana

🤘
available for hire
View GitHub Profile
@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
@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 / README.md
Last active March 11, 2018 19:45
fasttext files converter

based on Kyubyong/wordvectors#14 (comment)

Alex Dodge did a little poking around in the fasttext history, and, yes, they had a different file format a year ago.

  • There's no magic number or version at the top of the file.
  • There's no "pruneidx_size" value in the header for the dictionary object.
  • There's no "quant" boolean before each of the two matrix objects.

This is a script that will convert one of the old fasttext files to something the current version can read:

@widnyana
widnyana / forceunicode.py
Last active August 24, 2017 10:40
force string to unicode
def force_unicode(s, encoding='utf-8', strings_only=False, errors='strict'):
"""
Similar to smart_text, except that lazy instances are resolved to
strings, rather than kept as lazy objects.
If strings_only is True, don't convert (some) non-string-like objects.
"""
# Handle the common case first, saves 30-40% when s is an instance of
# six.text_type. This function gets called often in that setting.
@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 / galera-backup.sh
Created March 22, 2017 02:43
bash script to do a full backup & then incremental backups for galera cluster
#!/bin/bash
#: stolen from: https://github.com/sayajin101/Galera-Cluster-Percona-Backup
##############################################################################################
# Please install the following packages & repositories first #
# rpm -Uhv http://www.percona.com/downloads/percona-release/percona-release-0.0-1.x86_64.rpm #
# qpress.x86_64 rsync.x86_64 percona-xtrabackup.x86_64 #
##############################################################################################
[ $(which qpress > /dev/null 2>&1; echo ${?}) -ne 0 ] && { echo -e "\nqpress is required...exiting"; exit 1; };