Skip to content

Instantly share code, notes, and snippets.

View yvdjee's full-sized avatar
😎
I may be slow to respond.

Mako yvdjee

😎
I may be slow to respond.
View GitHub Profile
@yvdjee
yvdjee / simple_cors_server.py
Created October 13, 2023 04:51 — forked from acdha/simple_cors_server.py
Python 3: serve the current directory as HTTP while setting CORS headers for XHR debugging
#!/usr/bin/env python3
# encoding: utf-8
"""Use instead of `python3 -m http.server` when you need CORS"""
from http.server import HTTPServer, SimpleHTTPRequestHandler
class CORSRequestHandler(SimpleHTTPRequestHandler):
def end_headers(self):
self.send_header('Access-Control-Allow-Origin', '*')
@yvdjee
yvdjee / manual-uninstall-paragon-ntfs.sh
Created September 7, 2019 13:52 — forked from guycalledseven/manual-uninstall-paragon-ntfs.sh
Manually remove Paragon NTFS v15 leftovers MacOS
# after appcleaner does his magic, do this
sudo rm -rf "/Library/Application Support/Paragon Software/"
sudo rm /Library/LaunchDaemons/com.paragon-software.installer.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfs.loader.plist
sudo rm /Library/LaunchDaemons/com.paragon-software.ntfsd.plist
sudo rm /Library/LaunchAgents/com.paragon-software.ntfs.notification-agent.plist
sudo rm -rf /Library/Filesystems/ufsd_NTFS.fs/
sudo rm -rf /Library/PrivilegedHelperTools/com.paragon-software.installer
sudo rm -rf /Library/Extensions/ufsd_NTFS.kext/
@yvdjee
yvdjee / db_backup.sh
Created July 2, 2018 06:32 — forked from NARKOZ/db_backup.sh
MySQL backup shell script
#!/bin/bash
# Shell script to backup MySQL database
# Set these variables
MyUSER="" # DB_USERNAME
MyPASS="" # DB_PASSWORD
MyHOST="" # DB_HOSTNAME
# Backup Dest directory
DEST="" # /home/username/backups/DB
@yvdjee
yvdjee / softether-x64.sh
Last active April 19, 2018 16:06 — forked from m-tana/softether-x64.sh
Softether Script for x86_64 CentOS
#!/bin/bash
yum groupinstall "Development Tools" &&
# Define softether version
RTM=$(curl http://www.softether-download.com/files/softether/ | grep -o 'v[^"]*e' | grep rtm | tail -1)
IFS='-' read -r -a RTMS <<< "${RTM}"
# Get softether source
wget "http://www.softether-download.com/files/softether/${RTMS[0]}-${RTMS[1]}-${RTMS[2]}-${RTMS[3]}-${RTMS[4]}/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-${RTMS[0]}-${RTMS[1]}-${RTMS[2]}-${RTMS[3]}-linux-x64-64bit.tar.gz" -O /tmp/softether-vpnserver.tar.gz &&
#!/bin/bash
sudo yum update -y
sudo yum install tmux gcc wget htop epel-release fail2ban -y
wget -O vpnserver.tar.gz http://jp.softether-download.com/files/softether/v4.22-9634-beta-2016.11.27-tree/Linux/SoftEther_VPN_Server/64bit_-_Intel_x64_or_AMD64/softether-vpnserver-v4.22-9634-beta-2016.11.27-linux-x64-64bit.tar.gz
tar -zxvf vpnserver.tar.gz
cd vpnserver/
# printf '1\n1\n1\n' | ./.install.sh
@yvdjee
yvdjee / initd-nodhcp
Created April 19, 2018 16:00 — forked from abegodong/initd-nodhcp
Softether VPN + DNSMasq
#!/bin/sh
# chkconfig: 2345 99 01
# description: SoftEther VPN Server
DAEMON=/usr/local/vpnserver/vpnserver
LOCK=/var/lock/subsys/vpnserver
SERVER_IP=[SERVER_IP]
test -x $DAEMON || exit 0
case "$1" in
start)
$DAEMON start
@yvdjee
yvdjee / softether.sh
Last active November 13, 2023 13:43 — forked from bouroo/softether.sh
Install softether vpn server on ubuntu 16.04+
#!/bin/bash
# Register digitalocean with free credit https://m.do.co/c/4879bb02d178
# Create vps with 5usd price
# Update system
apt-get update && apt-get -y upgrade
# Get build tools
apt-get -y install build-essential wget curl gcc make wget tzdata git libreadline-dev libncurses-dev libssl-dev zlib1g-dev
# Define softether version
# http://lambdalisue.hatenablog.com/entry/2013/07/03/023934
sudo aptitude install -y libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev liblua5.2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev ruby-dev lua5.2 ruby mercurial
sudo aptitude remove vim vim-runtime gvim vim-tiny vim-common vim-gui-common
cd $HOME
mkdir src && cd src
hg clone https://code.google.com/p/vim/
cd vim
./configure --with-features=huge --disable-darwin --disable-selinux --enable-luainterp --enable-perlinterp --enable-pythoninterp --enable-python3interp --enable-tclinterp --enable-rubyinterp --enable-cscope --enable-multibyte --enable-xim --enable-fontset
make