Skip to content

Instantly share code, notes, and snippets.

View dogterbox's full-sized avatar
😴
Working from home

Teerapong Taengmuang dogterbox

😴
Working from home
View GitHub Profile
@dogterbox
dogterbox / linechat.py
Last active January 21, 2021 16:18
Sent message and image to LINE chat application.
import requests
import sys
# Get access token: https://notify-bot.line.me/my/
LINE_ACCESS_TOKEN = "XXXXXXXXXXXXXXXXXXXXXXXXXXXX"
URL_LINE = "https://notify-api.line.me/api/notify"
def sent(message=None, image=None):
if not(message or image):
import json
def to_txt(fname, data):
'''Save list to txt file.'''
with open(fname, 'w', encoding='utf-8') as file:
data = [str(d) for d in data]
file.write('\n'.join(data))
@fredjoseph
fredjoseph / OpenVPN.md
Last active January 5, 2026 02:02
[OpenVPN] Multi-TAP

OpenVPN, by default, installs only one TAP network interface. If you want to connect to multiple VPNs simultaneously you need a TAP interface for each VPN.

Add an additional TAP adapter

  • Open a command prompr with administrative rights
  • Go to the TAP install folder C:\Program Files\TAP-Windows\bin
  • Launch the addtap.bat script, the result will be :
    "devcon.exe" install "C:\Program Files\TAP-Windows\driver\OemWin2k.inf" tap0901
    

Device node created. Install is complete when drivers are installed...

@korakot
korakot / colab_thai.py
Last active September 26, 2022 08:13
Set matplotlib to Thai font on MacOS
# download font file มาก่อน
!wget https://awards.opdc.go.th/awards_opdc/assets/fonts/THSarabunNew/THSarabunNew.ttf
# import and install
import matplotlib.pyplot as plt
import matplotlib.font_manager as fm
font_list = fm.createFontList(['THSarabunNew.ttf'])
fm.fontManager.ttflist.extend(font_list)
# set font
plt.rcParams['font.family'] = 'TH Sarabun New'
plt.rcParams['xtick.labelsize'] = 20.0
@shamil
shamil / rundeck_executions_cleanup.sh
Last active August 7, 2024 17:44
Rundeck executions cleanup
#!/bin/bash -e
# see related issue: https://github.com/rundeck/rundeck/issues/357
# export required vars
export RD_URL=http://localhost:4440 RD_USER=admin RD_PASSWORD=admin RD_HTTP_TIMEOUT=300
# make sure rd & jq commands are in the PATH
which -- rd jq >/dev/null
del_executions() {
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active February 6, 2026 11:31
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@mshkrebtan
mshkrebtan / webex-ubuntu.md
Last active October 28, 2022 15:23
Run Cisco Webex on 64-bit Ubuntu 16.04

Run Cisco Webex on 64-bit Ubuntu 16.04

With Audio and Screen Sharing Enabled

Enable support for 32-bit executables

Add the i386 architecture to the list of dpkg architectures :

sudo dpkg --add-architecture i386
@Alex-Just
Alex-Just / strip_emoji.py
Last active April 9, 2025 08:48
Python regex to strip emoji from a string
import re
# http://stackoverflow.com/a/13752628/6762004
RE_EMOJI = re.compile('[\U00010000-\U0010ffff]', flags=re.UNICODE)
def strip_emoji(text):
return RE_EMOJI.sub(r'', text)
print(strip_emoji('🙄🤔'))
@karstenmueller
karstenmueller / aws_az_list.md
Created December 1, 2016 18:26
List of AWS availability zones for each AWS region

AWS Regions

Region Code Region Name Availability Zones
us-east-1* N. Virginia us-east-1a us-east-1b us-east-1c us-east-1d us-east-1e
us-east-2 Ohio us-east-2a us-east-2b us-east-2c
us-west-1* N. California us-west-1a us-west-1b us-west-1c
us-west-2 Oregon us-west-2a us-west-2b us-west-2c
eu-west-1 Ireland eu-west-1a eu-west-1b eu-west-1c
eu-central-1 Frankfurt eu-central-1a eu-central-1b
@StuartFarmer
StuartFarmer / classification-forex-model.py
Created October 24, 2016 02:27
Classification Forex Prediction Model
import csv
import random
import numpy as np
import matplotlib.pyplot as plt
import math
import os
os.environ["THEANO_FLAGS"] = "mode=FAST_RUN,device=gpu,floatX=float32,allow_gc=False"