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
| # Kebutuhan: env/bin/pip install ruamel.yaml | |
| # Ini untuk mengekstrak file ZIP hasil export berformat YOLO dari annotation | |
| # tool bernama Label Studio. Nanti akan terbentuk file YAML sebagai file | |
| # konfigurasi pelatihan: | |
| # env/bin/yolo train data=latihan.yaml | |
| import sys | |
| import os | |
| import shutil | |
| from zipfile import ZipFile | |
| from random import choice |
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
| # Sumber: https://randomnerdtutorials.com/micropython-wi-fi-manager-esp32-esp8266/ | |
| # Perubahan: | |
| # 1. Bug fixed saat SSID memiliki karakter spasi | |
| # 2. Password yang lebih mudah | |
| import network | |
| import socket | |
| import ure | |
| 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
| from datetime import date | |
| def bulan_depan(bulan, tahun): | |
| if bulan == 12: | |
| bulan_b = 1 | |
| tahun_b = tahun + 1 | |
| else: | |
| bulan_b = bulan + 1 | |
| tahun_b = tahun |
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 datetime import date | |
| def bulan_depan(bulan, tahun): | |
| if bulan == 12: | |
| bulan_b = 1 | |
| tahun_b = tahun + 1 | |
| else: | |
| bulan_b = bulan + 1 | |
| tahun_b = tahun |
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
| # Debian: apt-get install espeak | |
| # Other OS: http://espeak.sourceforge.net/download.html | |
| import sys | |
| import commands | |
| import subprocess | |
| from time import sleep | |
| from datetime import datetime | |
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
| # pip install xlrd | |
| import sys | |
| from xlrd import open_workbook | |
| filename = sys.argv[1] | |
| wb = open_workbook(filename) | |
| sheet = wb.sheet_by_index(0) | |
| for row in range(sheet.nrows): |
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
| def get_seq(controls, name): | |
| start = False | |
| key_value = ':'.join([name, 'sequence']) | |
| r = [] | |
| for key, value in controls: | |
| if key == '__start__' and value == key_value: | |
| start = True | |
| continue | |
| if key == '__end__' and value == key_value: | |
| start = False |
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 sqlalchemy import create_engine | |
| from sqlalchemy.ext.declarative import declarative_base | |
| from sqlalchemy import Column, Integer, String | |
| from sqlalchemy.orm import sessionmaker | |
| Base = declarative_base() | |
| class User(Base): | |
| __tablename__ = 'users' |
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
| import commands | |
| from glob import glob | |
| SHOW_KEYS = ['bcdUSB', 'idVendor', 'idProduct'] | |
| for bus in glob('/dev/bus/usb/*'): | |
| vals = dict() | |
| for dev in glob('{b}/*'.format(b=bus)): | |
| cmd = 'lsusb -D {d}'.format(d=dev) |
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
| # Web admin modem 3Com ADSL Wifi | |
| import socket | |
| socket.setdefaulttimeout(30) | |
| import urllib | |
| import urllib2 | |
| import sys | |
| from sgmllib import SGMLParser | |
| import os | |
| import mechanize |
NewerOlder