Skip to content

Instantly share code, notes, and snippets.

View ekapujiw2002's full-sized avatar

Eka Puji Widiyanto ekapujiw2002

View GitHub Profile
@ekapujiw2002
ekapujiw2002 / ssh-tutorial.md
Created June 26, 2019 08:55 — forked from slowkow/ssh-tutorial.md
ssh to a server without typing your password

How to ssh to a remote server without typing your password

Save yourself a few keystrokes. Follow the steps below:

  1. Run this Bash script on your laptop:

    #!/usr/bin/env bash
    

The hostname of your remote server.

@ekapujiw2002
ekapujiw2002 / main.py
Created November 28, 2018 07:41 — forked from linnil1/main.py
Image processing by Kivy on Android
from kivy.logger import Logger
import logging
Logger.setLevel(logging.TRACE)
from kivy.app import App
import kivy
from kivy.lang import Builder
from kivy.uix.widget import Widget
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.camera import Camera
@ekapujiw2002
ekapujiw2002 / kivy_cv.py
Created November 27, 2018 07:24 — forked from ExpandOcean/kivy_cv.py
kivy and opencv work together demo
# coding:utf-8
from kivy.app import App
from kivy.uix.image import Image
from kivy.clock import Clock
from kivy.graphics.texture import Texture
import cv2
class KivyCamera(Image):
def __init__(self, capture, fps, **kwargs):
@ekapujiw2002
ekapujiw2002 / systemd_sysvinit.md
Created November 5, 2018 01:51 — forked from rothgar/systemd_sysvinit.md
Systemd vs SysVinit

Services

action sysvinit systemd
start service service foo start systemctl start foo[.service]
stop service service foo stop systemctl stop foo[.service]
restart service service foo restart systemctl restart foo[.service]
reload service service foo reload systemctl reload foo[.service]
service status service foo status systemctl status foo[.service]
restart if running service foo condrestart systemctl condrestart foo[.service]
@ekapujiw2002
ekapujiw2002 / centering.py
Created September 19, 2018 06:38 — forked from saleph/centering.py
[qt5] center a window on screen
__author__ = 'tom'
import sys
from PyQt5.QtWidgets import QWidget, QDesktopWidget, QApplication
class Example(QWidget):
def __init__(self):
super().__init__()
self.init_ui()
@ekapujiw2002
ekapujiw2002 / center_text_on_image.py
Created July 3, 2018 04:12 — forked from xcsrz/center_text_on_image.py
Center text on an image with Python and OpenCV. Had to come up with it myself as no one was spelling this out anywhere (or google couldn't find it)
#!/usr/bin/env python
import numpy as np
import cv2
from time import sleep
# create blank image - y, x
img = np.zeros((600, 1000, 3), np.uint8)
# setup text
@ekapujiw2002
ekapujiw2002 / dominat-colors.py
Created July 2, 2018 02:30 — forked from skt7/dominat-colors.py
Dominant Colors in an image using python opencv and scikit-learn
import cv2
from sklearn.cluster import KMeans
class DominantColors:
CLUSTERS = None
IMAGE = None
COLORS = None
LABELS = None
@ekapujiw2002
ekapujiw2002 / KeyPinStore.java
Created June 10, 2018 22:38 — forked from ibnux/KeyPinStore.java
SSL Pinning Android using CloudFLare SSL
package your.package;
import android.content.Context;
import javax.net.ssl.SSLContext;
import javax.net.ssl.TrustManagerFactory;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.security.KeyManagementException;
@ekapujiw2002
ekapujiw2002 / read-rfid-on-rpi.py
Created June 7, 2018 04:21 — forked from softberries/read-rfid-on-rpi.py
RFID reading on raspberry pi
import sys
hid = { 4: 'a', 5: 'b', 6: 'c', 7: 'd', 8: 'e', 9: 'f', 10: 'g', 11: 'h', 12: 'i', 13: 'j', 14: 'k', 15: 'l', 16: 'm', 17: 'n', 18: 'o', 19: 'p', 20: 'q', 21: 'r', 22: 's', 23: 't', 24: 'u', 25: 'v', 26: 'w', 27: 'x', 28: 'y', 29: 'z', 30: '1', 31: '2', 32: '3', 33: '4', 34: '5', 35: '6', 36: '7', 37: '8', 38: '9', 39: '0', 44: ' ', 45: '-', 46: '=', 47: '[', 48: ']', 49: '\\', 51: ';' , 52: '\'', 53: '~', 54: ',', 55: '.', 56: '/' }
hid2 = { 4: 'A', 5: 'B', 6: 'C', 7: 'D', 8: 'E', 9: 'F', 10: 'G', 11: 'H', 12: 'I', 13: 'J', 14: 'K', 15: 'L', 16: 'M', 17: 'N', 18: 'O', 19: 'P', 20: 'Q', 21: 'R', 22: 'S', 23: 'T', 24: 'U', 25: 'V', 26: 'W', 27: 'X', 28: 'Y', 29: 'Z', 30: '!', 31: '@', 32: '#', 33: '$', 34: '%', 35: '^', 36: '&', 37: '*', 38: '(', 39: ')', 44: ' ', 45: '_', 46: '+', 47: '{', 48: '}', 49: '|', 51: ':' , 52: '"', 53: '~', 54: '<', 55: '>', 56: '?' }
fp = open('/dev/hidraw0', 'rb')
ss = ""
shift = False
done = False
while not done:
@ekapujiw2002
ekapujiw2002 / AsyncWebUpdate.ino
Created May 4, 2018 07:57 — forked from JMishou/AsyncWebUpdate.ino
ESPAsyncWebServer webupdate
/*
__/\\\\____________/\\\\__/\\\\\\\\\\\_____/\\\\\\\\\\\____/\\\________/\\\_
_\/\\\\\\________/\\\\\\_\/////\\\///____/\\\/////////\\\_\/\\\_______\/\\\_
_\/\\\//\\\____/\\\//\\\_____\/\\\______\//\\\______\///__\/\\\_______\/\\\_
_\/\\\\///\\\/\\\/_\/\\\_____\/\\\_______\////\\\_________\/\\\\\\\\\\\\\\\_
_\/\\\__\///\\\/___\/\\\_____\/\\\__________\////\\\______\/\\\/////////\\\_
_\/\\\____\///_____\/\\\_____\/\\\_____________\////\\\___\/\\\_______\/\\\_
_\/\\\_____________\/\\\_____\/\\\______/\\\______\//\\\__\/\\\_______\/\\\_
_\/\\\_____________\/\\\__/\\\\\\\\\\\_\///\\\\\\\\\\\/___\/\\\_______\/\\\_
_\///______________\///__\///////////____\///////////_____\///________\///__