Skip to content

Instantly share code, notes, and snippets.

@dahebolangkuan
dahebolangkuan / claude-code-prompt.txt
Created August 22, 2025 03:53 — forked from agokrani/claude-code-prompt.txt
Claude Code System Prompt
'system':
[
{
'type': 'text',
'text': "You are Claude Code, Anthropic's official CLI for Claude.",
'cache_control': {'type': 'ephemeral'}
},
{
'type': 'text',
'text': 'You are an interactive CLI tool that helps users with software engineering tasks.
Running a VPN Server with OpenVPN and Stunnel
May 4, 2016
The Raspberry Pi that I setup as a web server has also been doing double duty as a VPN server. I use OpenVPN, and wrap it with Stunnel since I sometimes need to use the VPN in countries that filter their Internet access. Stunnel makes the VPN look like HTTPS traffic, so this gets around deep packet inspection.
Install the Software and Generate Certificates/Keys
Installing the software takes just one command:
sudo apt-get install openvpn stunnel4
Some prep work:
@dahebolangkuan
dahebolangkuan / hello.py
Created February 13, 2024 07:52 — forked from arajkumar/hello.py
Pydantic and Flask formdata validation
from flask import Flask
from flask import request
from werkzeug.datastructures import FileStorage
from pydantic import BaseModel
app = Flask(__name__)
class FormData(BaseModel):
file_path: str
@dahebolangkuan
dahebolangkuan / mplfinance_streamlit_demo.py
Created October 31, 2023 07:42 — forked from asehmi/mplfinance_streamlit_demo.py
How to use mplfinance in Streamlit
from datetime import date, datetime
import streamlit as st
import pandas as pd
import mplfinance as mpf
from pandas_datareader import data as pdr
@st.experimental_memo(persist='disk')
def get_historical_data(symbol, start_date = None):
df = pdr.get_data_yahoo(symbol, start=start_date, end=datetime.now())
for col in df.columns:
def readmail(volume):
time.sleep(1.5)
m = imaplib.IMAP4_SSL("imap.gmail.com")
m.login(user, pwd)
m.select('"[Gmail]/All Mail"')
resp, items = m.search(None,
"NOT SEEN FROM tradingview")
items = items[0].split()
for emailid in items:
resp, data = m.fetch(emailid,
@dahebolangkuan
dahebolangkuan / spherical_coords.py
Created November 17, 2022 09:05 — forked from yigithsyn/spherical_coords.py
Python: Spherical coordinates transformation
"""
# spherical_coords.py
Convert between (theta, phi) and (azimuth, elevation) coordinate systems.
Author: Danny Price
License: MIT
## Overview
@dahebolangkuan
dahebolangkuan / sqlSync.sh
Created November 15, 2022 05:58 — forked from ascalabro/sqlSync.sh
sync two MySQL servers
#!/bin/sh
MINIMUM_ARGS=2 # Require a database name and table name(s). Change to 1 if need to do whole database and only provide database name
# These are the two servers being worked on
# Change configuration here
FROM_MYSQL_HOST=localhost
FROM_USERNAME=myuser
FROM_PASSWORD=mypas
@dahebolangkuan
dahebolangkuan / killbutmakeitlooklikeanaccident.sh
Created July 17, 2022 13:09 — forked from moyix/killbutmakeitlooklikeanaccident.sh
Script to inject an exit(0) syscall into a running process. NB: only x86_64 for now!
#!/bin/bash
gdb -p "$1" -batch -ex 'set {short}$rip = 0x050f' -ex 'set $rax=231' -ex 'set $rdi=0' -ex 'cont'
@dahebolangkuan
dahebolangkuan / pythonActualPrice.ipynb
Last active July 17, 2022 07:25 — forked from ZeccaLehn/pythonActualPrice.ipynb
Py: Adjust Splits and Dividends from Real Prices using Quandl Finance Data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dahebolangkuan
dahebolangkuan / cli.py
Created April 3, 2022 01:25 — forked from securisec/cli.py
How to build a fully dynamic, self documention fuzzy cli for any class in python
#!/usr/bin/env python3
import inspect
import argparse
import fire
from docstring_parser import parse
from prompt_toolkit.completion import Completer, Completion, FuzzyCompleter
from prompt_toolkit import PromptSession
from search.lsgrep import SearchFiles