Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

"""
This script contains adjusted cli codes from https://github.com/openai/whisper but uses https://github.com/guillaumekln/faster-whisper instead
Initialize models using this step:
mkdir -p ~/.cache/faster-whisper
# assuming a python venv installed on venv dir....
venv/bin/python -m pip install --force-reinstall "faster-whisper @ https://github.com/guillaumekln/faster-whisper/archive/refs/heads/master.tar.gz"
var zeroPad = function(n) {
return n > 9 ? '' + n : '0' + n;
}
var formatDate = function(dt) {
return "" + dt.getFullYear() + "-" + zeroPad(dt.getMonth() + 1) + "-" + zeroPad(dt.getDate());
}
exports.genDateRange = function(_startDate, _endDate) {
var startDate = new Date(_startDate);
@dodysw
dodysw / restartBolt.py
Created July 7, 2014 06:57
Bolt! Super 4G LTE modem restart script. Why? 1) I'm not sure why this works. Unbased explanation: This modem type frequently stucked to a bad signal probably coming from a far BTS. Restarting forces it to reacquire 4G signals, hopefuly getting a closer BTS.
#!/usr/bin/env python
# Bolt! Super 4G LTE modem restart script.
# Why? 1) I'm not sure why this works. Unbased explanation: This modem type frequently stucked to a bad signal probably coming from a far BTS. Restarting forces it to reacquire 4G signals, hopefuly getting a closer BTS.
# Copyright 2014 Dody Suria Wijaya <dodysw@gmail.com>
import urllib, urllib2, base64
PASSWORD = 'admin'
MODEM_IP = '192.168.1.1'
dataLogin = dict(isTest='false', goformId='LOGIN', password=base64.b64encode(PASSWORD))
dataRestart = dict(isTest='false', goformId='REBOOT_DEVICE')
url = "http://%s/goform/goform_set_cmd_process" % MODEM_IP
@dodysw
dodysw / gist:9704142
Last active August 29, 2015 13:57
Creating self signed certificate supporting multiple/wildchars domains at nginx
sudo su
cd /etc/nginx
mkdir sslmulti
cd sslmulti
# create a new certificate authority (for importing to our browser so that all child certs are trusted automatically)
openssl genrsa -out rootCA.key 2048
openssl req -x509 -new -nodes -key rootCA.key -days 1024 -out rootCA.pem
# you can import rootCA.pem to your browser now
"""
Pull a table of Indonesia province (Propinsi), city/regency name and type (Kotamadya/Kabupaten), village name (Kelurahan/Desa), and their zip code into csv file
Dody Suria Wijaya 2014 dody@cryptolab.net
"""
import urllib2, re