Skip to content

Instantly share code, notes, and snippets.

@windoze
windoze / install-dropbox.sh
Last active March 13, 2021 02:30
Install Dropbox on Headless Ubuntu 20.04
#!/bin/sh
sudo apt install -y libxdamage1 libxcb-glx0 libglapi-mesa libxcb-dri2-0 libxcb-dri3-0 libxcb-present0 libxcb-sync1 libxshmfence1 libxxf86vm1 libxfixes3
cd ~ && wget -O - "https://www.dropbox.com/download?plat=lnx.x86_64" | tar xzf -
wget -O ~/bin/dropbox.py 'https://www.dropbox.com/download?dl=packages/dropbox.py'
chmod +x ~/bin/dropbox.py
~/.dropbox-dist/dropboxd
# ~/bin/dropbox.py autostart
@windoze
windoze / randstr.py
Created February 6, 2020 08:40
Generate random string
#!/usr/bin/python3
import string
import random
import itertools
import argparse
IDENT_FIRST = string.ascii_letters + '_'
IDENT_LAST = string.ascii_letters + string.digits + '_'
@windoze
windoze / RpcServer.kt
Created January 26, 2019 19:02
Simple implementation of RPC infrastructure over Vertx EventBus
import com.fasterxml.jackson.core.type.TypeReference
import io.vertx.core.AsyncResult
import io.vertx.core.Handler
import io.vertx.core.Vertx
import io.vertx.core.eventbus.Message
import io.vertx.core.json.Json
import io.vertx.core.logging.Logger
import io.vertx.core.logging.LoggerFactory
import io.vertx.kotlin.coroutines.CoroutineVerticle
import io.vertx.kotlin.coroutines.dispatcher
@windoze
windoze / esadaptor.kt
Last active August 3, 2018 20:55
ElasticSearch Java REST Client Vert.x adaptor
fun <Req, Resp> asFuture(func: (Req, ActionListener<Resp>, Array<out Header>) -> Unit, req: Req, vararg headers: Header) = Future.future<Resp>().apply {
func(req, object : ActionListener<Resp> {
override fun onFailure(e: Exception?) {
fail(e)
}
override fun onResponse(response: Resp?) {
complete(response)
}
}, headers)
@windoze
windoze / douyinsig.py
Created July 25, 2018 15:34 — forked from a232319779/douyinsig.py
douyin checksum calc.
# -*- coding: utf-8 -*-
# @Time : 2017/12/23 16:07
# @Author : ddvv
# @Site :
# @File : douyincore.py
# @Software: PyCharm
import hashlib
class calcSig(object):
@windoze
windoze / android-wait-for-emulator.sh
Created July 11, 2018 05:44
Wait for emulator being fully started.
#!/bin/bash
# Originally written by Ralf Kistner <[email protected]>, but placed in the public domain
set +e
bootanim=""
failcounter=0
timeout_in_sec=360
adb shell content query --uri content://settings/secure --where "name=\'android_id\'"
adb shell content delete --uri content://settings/secure --where "name=\'android_id\'"
adb shell content insert --uri content://settings/secure --bind name:s:android_id --bind value:s:7373de1e9e9670c2
package cn.azure.chatbot.classifier
import com.github.jfasttext.JFastText
import com.huaban.analysis.jieba.JiebaSegmenter
import com.huaban.analysis.jieba.JiebaSegmenter.SegMode
import com.intel.analytics.bigdl.nn.Module
import com.intel.analytics.bigdl.nn.abstractnn.{AbstractModule, Activity}
import com.intel.analytics.bigdl.tensor.Tensor
import org.slf4j.LoggerFactory
@windoze
windoze / kmskeys10.txt
Created November 24, 2017 15:14 — forked from CHEF-KOCH/kmskeys10.txt
Windows 10 KMS Keys
Windows.10.and.Office.2016.gVLK
#####################################################################
# Install/Uninstall keys #
#####################################################################
1.) Uninstall the current product by entering the “uninstall product key” extension:
slmgr.vbs /upk
2.) Install the key that you obtained above for “Windows Srv 2012R2 DataCtr/Std KMS for Windows 10”
drop table comment_f;
drop table comment_hastag_tag_f;
drop table forum_f;
drop table forum_hasmember_person_f;
drop table forum_hastag_tag_f;
drop table organisation_f;
drop table person_f;
drop table person_email_emailaddress_f;
drop table person_hasinterest_tag_f;
drop table person_knows_person_f;