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 / 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)
@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 / 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 / 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 / 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 / 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 / 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 / load_jpeg_with_tensorflow.py
Created January 1, 2018 17:08 — forked from eerwitt/load_jpeg_with_tensorflow.py
Example loading multiple JPEG files with TensorFlow and make them available as Tensors with the shape [[R, G, B], ... ].
# Typical setup to include TensorFlow.
import tensorflow as tf
# Make a queue of file names including all the JPEG images files in the relative
# image directory.
filename_queue = tf.train.string_input_producer(
tf.train.match_filenames_once("./images/*.jpg"))
# Read an entire image file which is required since they're JPEGs, if the images
# are too large they could be split in advance to smaller files or use the Fixed
@imamdigmi
imamdigmi / xorg.conf
Last active February 1, 2018 08:02
My Xorg configuration with NVIDIA
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0:2:0"
{
"workbench.iconTheme": "eq-material-theme-icons",
"atomKeymap.promptV3Features": true,
"editor.multiCursorModifier": "ctrlCmd",
"editor.formatOnPaste": true,
"workbench.colorTheme": "Material Theme",
"editor.fontFamily": "'Fira Code Retina', 'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
"editor.tabCompletion": true,
"editor.lineHeight": 27,
"editor.minimap.enabled": false,