Skip to content

Instantly share code, notes, and snippets.

View imamdigmi's full-sized avatar
😐
Focusing

Imam Digmi imamdigmi

😐
Focusing
View GitHub Profile
@imamdigmi
imamdigmi / generate_shape.py
Last active January 3, 2018 15:10
Generate a bunch of shape using Matplotlib in Python
"""
This file I created for generating image file for training and validation datasets for CNN
"""
import matplotlib.path as mpath
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt
import random
import math
@imamdigmi
imamdigmi / gist:5533380fa1d8288f4aaaa93e2da449ae
Created March 7, 2018 12:11 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@imamdigmi
imamdigmi / video_save.py
Last active March 18, 2022 18:26
TensorFlow object detection with video and save the output using OpenCV
"""
This notebook will demontrate a pre-trained model to recognition plate number in an image.
Make sure to follow the [installation instructions](https://github.com/imamdigmi/plate-number-recognition#setup) before you start.
"""
import numpy as np
import os
import six.moves.urllib as urllib
import sys
import tarfile
import tensorflow as tf
@imamdigmi
imamdigmi / i3-gaps-install.sh
Created June 7, 2018 16:48 — forked from aaronsaderholm/i3-gaps-install.sh
Install i3-gaps on Ubuntu 16.04
#!/bin/bash
# Install i3-gaps on Ubuntu 16
set -e
set -x
sudo apt-get update && sudo apt-get -y dist-upgrade && \
sudo apt-get install -y libxcb1-dev libxcb-keysyms1-dev libpango1.0-dev libxcb-util0-dev libxcb-icccm4-dev libyajl-dev libstartup-notification0-dev libxcb-randr0-dev libev-dev libxcb-cursor-dev libxcb-xinerama0-dev libxcb-xkb-dev libxkbcommon-dev libxkbcommon-x11-dev autoconf xutils-dev dh-autoreconf
mkdir -p $HOME/repos
cd $HOME/repos
@imamdigmi
imamdigmi / ssh-telegram.sh
Created September 3, 2018 18:33 — forked from zamber/ssh-telegram.sh
Bash Script to notify via Telegram Bot API when user log in SSH
# save it as /etc/profile.d/ssh-telegram.sh
# use sed to parse JSON from ipinfo.io
# you can get your user_id by writing to @get_id_bot
USERID="<target_user_id>"
KEY="<bot_private_key>"
TIMEOUT="10"
URL="https://api.telegram.org/bot$KEY/sendMessage"
DATE_EXEC="$(date "+%d %b %Y %H:%M")"
TMPFILE='/tmp/ipinfo-$DATE_EXEC.txt'
if [ -n "$SSH_CLIENT" ] && [ -z "$TMUX" ]; then
@imamdigmi
imamdigmi / domain-name.conf
Created November 22, 2018 18:08
Nginx Multitenance
server {
listen 80;
listen 443 ssl;
ssl_certificate /etc/ssl/imamdigmi.crt;
ssl_certificate_key /etc/ssl/imamdigmi.key;
server_name ~^www\.(?<user>.+\.)?imamdigmi\.com$;
return 301 "$scheme://${user}imamdigmi.com$request_uri";
}
@imamdigmi
imamdigmi / pypdf2_metadata_update.py
Last active December 19, 2018 04:47
Add/update PDF file metadata
import os
import sys
from PyPDF2 import PdfFileReader, PdfFileWriter
from PyPDF2.generic import NameObject, createStringObject
DIR = '/home/idiot/Documents'
FILE = 'contoh.pdf'
FILE_IN = os.path.join(DIR, FILE)
Yogyakarta 130
Jakarta Selatan 193
Semarang 109
Bandung 170
Malang 1343
Bogor 980
Samarinda 30
Bekasi 43
Jambi 541
Palangkaraya 312
yum install python-setuptools -yy
easy_install supervisor
echo_supervisord_conf > /etc/supervisord.conf
mkdir /etc/supervisord.d/
[include]
files = /etc/supervisord.d/*.conf
[inet_http_server]
port = *:9001
@imamdigmi
imamdigmi / airflow-dag-csv-to-mysql.py
Created January 15, 2019 15:46
Airflow Ftp CSV to SQL
"""
Code that goes along with the Airflow tutorial located at:
https://github.com/airbnb/airflow/blob/master/airflow/example_dags/tutorial.py
"""
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from airflow.operators.generic_transfer import GenericTransfer
from airflow.contrib.hooks import FTPHook
from airflow.hooks.mysql_hook import MySqlHook