Create a folder to store the databases :
mkdir -p /usr/share/GeoIP
Download Country IP database
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
| importScripts('https://storage.googleapis.com/workbox-cdn/releases/3.0.0/workbox-sw.js') | |
| if (workbox) { | |
| console.log(`Workbox is loaded`) | |
| workbox.setConfig({ debug: true }) | |
| workbox.core.setLogLevel(workbox.core.LOG_LEVELS.log) | |
| workbox.core.setCacheNameDetails({ | |
| prefix: 'localhost', |
| #!/usr/bin/bash | |
| npx -p @vue/cli \ | |
| -p @vue/cli-service-global \ | |
| -p pug \ | |
| -p pug-loader \ | |
| -c "echo '<template lang="pug"> | |
| div | |
| h1 Zero-config Prototyping | |
| </template>' > App.vue && vue serve" |
| # List containers | |
| alias dps='docker ps' | |
| # Fetch the logs of a container | |
| dl() { | |
| docker logs $1 -f | |
| } | |
| # Run a command in a running container | |
| de() { |
| if [ -f ~/.bash_docker_compose ]; then | |
| . ~/.bash_docker_compose | |
| fi |
Create a folder to store the databases :
mkdir -p /usr/share/GeoIP
Download Country IP database
wget http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz
gunzip GeoIP.dat.gz
| const url = require('url') | |
| const fs = require('fs') | |
| const path = require('path') | |
| const { send } = require('micro') | |
| const mime = require('mime') | |
| module.exports = async (req, res) => { | |
| const parseUrl = url.parse(req.url) | |
| let file = `.${parseUrl.pathname}` |
| { | |
| "Reset": { | |
| "prefix": "reset", | |
| "scope": "stylus", | |
| "body": [ | |
| "*", | |
| "*::before", | |
| "*::after", | |
| " box-sizing border-box", | |
| "", |
| const h2 = require('http2') | |
| const { run, send } = require('micro') | |
| const cert = require('openssl-self-signed-certificate') | |
| const { PORT = 3443 } = process.env | |
| const options = { | |
| key: cert.key, | |
| cert: cert.cert, | |
| passphrase: cert.passphrase | |
| } |
| // Array utils ///////////////////////////////////////////////////////////////// | |
| export const combine = (...arrays) => [].concat(...arrays) | |
| export const compact = arr => arr.filter(Boolean) | |
| export const contains = (() => Array.prototype.includes | |
| ? (arr, value) => arr.includes(value) | |
| : (arr, value) => arr.some(el => el === value) | |
| )() |
| alias headers='curl -I -s -X GET' |