This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding:utf-8 -*- | |
import requests | |
import json | |
from bs4 import BeautifulSoup | |
def download_file(url): | |
local_filename = url.split('/')[-1] | |
r = requests.get(url, stream=True) | |
with open(local_filename, 'wb') as f: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import connection | |
from django.conf import settings | |
cursor = connection.cursor() | |
cursor.execute("USE "+settings.DATABASES['default']['NAME']) | |
cursor.execute('SHOW TABLES') | |
tables = cursor | |
sql = '' | |
reverse_sql = '' | |
for (table_name,) in tables: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script ini hanyalah proof of concept untuk menyimpan laman satu website per 5 detik | |
# Script semacam ini sudah dibuktikan cara kerjanya oleh pak Budi Rahardjo di https://www.youtube.com/watch?v=DYlgavNY9LE | |
# Untuk menjalankan script ini dibutuhkan python3 dan library selenium dengan chromedriver | |
# POC ini hanya menyimpan 5 berkas saja. Anda bisa menambahkan sesuka Anda. | |
# Note: ini hanya script menyimpan screenshot, belum menjalankan fungsi seperti select input form. Itu akan ada di gist lain. | |
from selenium import webdriver | |
import time | |
browser = webdriver.Chrome() | |
browser.get('https://pemilu2019.kpu.go.id/#/ppwp/hitung-suara/') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Sebagai kelanjutan dari script saya sebelumnya (save_screenshot.py) | |
# Script ini membuka laman kpu, memilih berurutan Propinsi, Kabupaten, Kecamatan, Kelurahan dan TPS | |
# Di penghujung proses, dilakukan penyimpanan screenshot. | |
# Sebagai POC, saya batasi saja 5 TPS | |
from selenium import webdriver | |
from selenium.webdriver.common.by import By | |
from selenium.webdriver.support.ui import WebDriverWait | |
from selenium.webdriver.support import expected_conditions as EC | |
from datetime import datetime | |
import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
TITLE Mengubah HOSTS file karena indihomesux | |
COLOR F0 | |
ECHO. | |
:: BatchGotAdmin | |
:------------------------------------- | |
REM --> Check for permissions | |
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# --------------------------------------------------- | |
# Indihomsux | |
# --------------------------------------------------- | |
127.0.0.1 x-tags.net | |
127.0.0.1 a01.uadexchange.com | |
127.0.0.1 cdn.uzone.id | |
127.0.0.1 cdn3.uzone.id | |
127.0.0.1 cfs.uzone.id | |
127.0.0.1 csf.uzone.id | |
127.0.0.1 d01.notifa.info |