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 / 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; };
@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
}