Skip to content

Instantly share code, notes, and snippets.

View hanasuru's full-sized avatar
💤
~ 寝てる ~

M Faqih Jihan Insani hanasuru

💤
~ 寝てる ~
View GitHub Profile
@hanasuru
hanasuru / TwitDumper.py
Last active February 26, 2019 09:13
A simple tweet-dumper based on Twitter API for data gathering of specific keyword
#/usr/bin/python2
from datetime import datetime, timedelta
from requests_oauthlib import OAuth1
from email.utils import parsedate_tz
import requests
import json, time
class TwitDumperConfig:
RESP_CODE = {
400: 'Bad Request',
@hanasuru
hanasuru / ssh_tun.py
Last active December 23, 2021 15:59
Basic Implementation of Remote SSH-FORWARDING of multiple port instance
#!/usr/bin/python2
from sys import argv
from os import system
CMD = 'autossh -M 0 -o "ServerAliveInterval 30" -o "ServerAliveCountMax 3"'
DEF_SERVER = '0.0.0.0'
DEF_LOCAL = '127.0.0.1'
DEF_TUN = 30000
@hanasuru
hanasuru / rpld.py
Last active March 12, 2019 11:03
linear-regression
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LinearRegression
from sklearn import metrics
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np
dataset = pd.read_csv('machine.csv')
X = dataset[['125', '256', '6000','256.1','16','128']]
Y = dataset['198']
@hanasuru
hanasuru / rod
Last active January 24, 2025 05:55
Reverse octal-dump
#!/usr/bin/env python
from __future__ import unicode_literals
from __future__ import division
import struct
import sys
import re
RULE = re.compile(r'(\d{7,})((\s?\d{6}){0,8})')