We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
We have moved: https://github.com/magnetikonline/linuxmicrosoftievirtualmachines
Due to the popularity of this Gist, and the work in keeping it updated via a Gist, all future updates will take place at the above location. Thanks!
| # Python http.server that sets Access-Control-Allow-Origin header. | |
| # https://gist.github.com/razor-x/9542707 | |
| import os | |
| import sys | |
| import http.server | |
| import socketserver | |
| PORT = 8000 |
| -- Auto-reload config | |
| function reloadConfig(files) | |
| doReload = false | |
| for _,file in pairs(files) do | |
| if file:sub(-4) == ".lua" then | |
| doReload = true | |
| end | |
| end | |
| if doReload then | |
| hs.reload() |
| # Drush autocompletion | |
| # | |
| # Place this in your ~/.config/fish/completions/ directory, or in the | |
| # /etc/fish/completions directory to make it available for all users. | |
| function __complete_drush | |
| drush --early=includes/complete.inc --verbose=0 (commandline -cpo) (commandline -t 2> /dev/null) | cut -d " " -f 1 | |
| end | |
| complete -x -c drush -d "Drush" -a "(__complete_drush)" |
| # Habilitar o PHP 7.0 | |
| AddHandler application/x-httpd-php70 .php | |
| <IfModule mod_suphp.c> | |
| suPHP_ConfigPath /opt/php70/lib | |
| </IfModule> |
| curl -s https://api.github.com/users/milanboers/repos | grep \"clone_url\" | awk '{print $2}' | sed -e 's/"//g' -e 's/,//g' | xargs -n1 git clone |
| #!/bin/sh | |
| # up - v2 - script to keep your Mac up-to-date (OS, Homebrew, and App Store updates) via the command line | |
| # run thus to to install: cd /usr/local/bin && curl -s -O https://gist.githubusercontent.com/mayel/c07bc0acb91824501d5bdbdc9eb7b33a/raw/08821f64c067327ea68a1a817eb43657db10f10e/up && chmod 755 /usr/local/bin/up | |
| # and then run it anytime by simply entering the command: up | |
| # By https://github.com/mayel based on a script by https://github.com/imwally | |
| # homebrew |
This is a docker-compose file for a simple, secure torrent setup. It includes [rTorrent] (a torrent client), [flood] (a web interface for rTorrent), [OpenVPN] (to tunnel traffic through your ISP) and a simple iptables firewall to allow rTorrent to only access the internet through a VPN.
To run everything, put your open vpn configuration file in ./vpn.ovpn and the
other configuration files from this gist in a directory then go to that
| from nltk.corpus import stopwords | |
| from nltk.tokenize import sent_tokenize, word_tokenize | |
| ##Tokenizing - Splitting sentences and words from the body of text. | |
| ##Part of Speech tagging | |
| ##Corpus - Body of text, singular. Corpora is the plural of this. | |
| ##Example: A collection of medical journals. | |
| ##Lexicon - Words and their meanings. |
I recently implemented Nginx HTTP content caching on our WordPress web servers to improve page load speeds and eliminate redundant, unneeded server-side page rendering. Caching the pages was relatively straightforward, but clearing the cache required a custom workaround.
Nginx comes in two versions: free and “Nginx Plus” at $2,500/year. The free version of Nginx does not offer the needed cache-clearing features of Nginx Plus, and I wasn’t comfortable paying $20,000 for 8 instances without trying to build my own solution.
Our Nginx servers run as an HTTP proxy for multiple PHP/MySQL-backed WordPress sites. The goal was to cache the dynamic PHP HTML responses in Nginx and serve the HTML pages from Nginx to avoid redundant, CPU-intensive PHP renders.
The example below shows how PHP response caching is configured for a site (other nginx configuration details are excluded for brevity). A cache named cachedemo-prod is defined to store cached HTML f