Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
import qrcode
import pprint # noqa
import sys # noqa
import csv
for i in csv.reader(file('1.csv'), dialect='excel'):
o = dict(
@spikeekips
spikeekips / README.md
Last active September 12, 2016 14:52
Copy files with printing filename and progress
@spikeekips
spikeekips / rename_database_in_mysql.sql
Created October 4, 2016 06:44
Rename database in mysql; but, it move table to new database.
-- move table from `publicassets_20160930` to `publicassets`
SELECT
CONCAT('RENAME TABLE ',table_schema,'.', table_name, ' TO ','publicassets.', table_name,';')
FROM
information_schema.TABLES
WHERE
table_schema LIKE 'publicassets_20160930';
@spikeekips
spikeekips / set-nameserver-in-ubuntu.md
Last active October 4, 2016 16:59
Simple way to set the primary nameservers in Ubuntu

| from http://askubuntu.com/questions/479506/override-dns-nameserver

Add the desired nameserver in /etc/resolvconf/resolv.conf.d/head like this,

# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
#     DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
namserver 8.8.8.8
namserver 168.126.63.1
$ sudo mount -o nosuid,locallocks,nfc,actimeo=1 -t nfs 192.168.99.100:/data/share share
import org.apache.spark.ml.feature.{CountVectorizer, RegexTokenizer, StopWordsRemover}
import org.apache.spark.mllib.clustering.{LDA, OnlineLDAOptimizer}
import org.apache.spark.mllib.linalg.Vector
import sqlContext.implicits._
val numTopics: Int = 100
val maxIterations: Int = 100
val vocabSize: Int = 10000
@spikeekips
spikeekips / NaiveBayes_SentimentAnalysis.ipynb
Created October 30, 2016 11:28
Sentiment Analysis with MLlib
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@spikeekips
spikeekips / set-key-repeat-in-osx.md
Created November 4, 2016 18:20
Set key repeat in osx
@spikeekips
spikeekips / gist:0b402ccd470394cd5ff0372975b48331
Created November 9, 2016 05:52
How to create self signed certificate
http://www.akadia.com/services/ssh_test_certificate.html