Skip to content

Instantly share code, notes, and snippets.

@felixmon
felixmon / SimpleHTTPServerWithUpload.py
Created September 17, 2020 15:44 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@felixmon
felixmon / creative-cloud-disable.md
Created June 15, 2019 10:23 — forked from andreibosco/creative-cloud-disable.md
disable creative cloud startup on mac
@felixmon
felixmon / compress-pdf-with-gs.md
Created March 11, 2019 09:28 — forked from guifromrio/compress-pdf-with-gs.md
Compress PDF files with ghostscript

This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.

ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

Other options for PDFSETTINGS:

  • /screen selects low-resolution output similar to the Acrobat Distiller "Screen Optimized" setting.
  • /ebook selects medium-resolution output similar to the Acrobat Distiller "eBook" setting.
  • /printer selects output similar to the Acrobat Distiller "Print Optimized" setting.
  • /prepress selects output similar to Acrobat Distiller "Prepress Optimized" setting.
wget https://github.com/xtaci/kcptun/releases/download/v20170525/kcptun-linux-amd64-20170525.tar.gz
tar xvf kcptun-linux-amd64-20170525.tar.gz
sudo mv server_linux_amd64 /usr/local/bin/kcptun_server
sudo mv client_linux_amd64 /usr/local/bin/kcptun_client
sudo mkdir -p /etc/kcptun
sudo bash -c "cat <<EOT > /etc/kcptun/server_conf.json
{
\"listen\": \":4321\",
\"target\": \"127.0.0.1:8421\",
@felixmon
felixmon / auto_update.sh
Created February 3, 2019 16:37 — forked from quericy/auto_update.sh
Auto update tracker list of aria2 config in Mac OSX
#!/bin/bash
DAEMON=/usr/local/Cellar/aria2/1.31.0/bin/aria2c
PID_NAME=aria2c
PID=$(ps ux | awk '/aria2c/ && !/awk/ {print $2}')
CONFIG_PATH='/path/to/aria2.conf'
TRACKER_URL='https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all_ip.txt'
#####