If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.
This should fit most setups (not mine though 😉)
#!/bin/bash | |
set -euo pipefail | |
IF=<if> | |
URL="https://wirehub.org/<user>/n/<net>/device/<id>/download?invite_code=<code>" | |
TMPFILE="$(mktemp)" | |
SPLITDIR="$(mktemp -d)" | |
DEST=/etc/wireguard/"$IF".conf | |
cleanup() { | |
rm -f "${TMPFILE}" |
If you don't know what Wireguard is, well, you should. It's fast, easy to setup and highly configurable. We will configure Wireguard for multiple users with various restrictions using iptables.
This should fit most setups (not mine though 😉)
// per https://docs.npmjs.com/misc/scripts, npm exposes a bunch of variables to | |
// the environment prefixed with npm_config_*, npm_package_* and npm_lifecycle_*. | |
// Here's a list of all variables exposed in my setup. | |
npm_config_access= | |
npm_config_allow_same_version= | |
npm_config_also= | |
npm_config_always_auth= | |
npm_config_argv='{"remain":[],"cooked":["run","foo"],"original":["run","foo"]}' | |
npm_config_auth_type=legacy |
package main | |
import ( | |
"flag" | |
"fmt" | |
"net/http" | |
) | |
func main() { | |
var port string |
mainly used in start-up script
When we play with iptables aka firewall we might end up in situation, where we execute rule, which has unforseen impact - lock yourself out. Recovering from this situation is necessity.
How to:
- Enable reboot via SMS.
- Test all commands in shell first before putting them into Start-up script. This way the command will be wiped out, when unit is rebooted.
module.exports = function(grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON('package.json'), | |
shell: { | |
jekyllBuild: { | |
command: 'jekyll build' | |
}, | |
jekyllServe: { | |
command: 'jekyll serve' | |
} |
A lot of times you are developing a web application on your own laptop or home computer and would like to demo it to the public. Most of those times you are behind a router/firewall and you don't have a public IP address. Instead of configuring routers (often not possible), this solution gives you a public URL that's reverse tunnelled via ssh to your laptop.
Because of the relaxation of the sshd setup, it's best used on a dedicated virtual machine just for this (an Amazon micro instance for example).
by Dale Sande
CSS has had a long and sordid past. A developer never sets out with the goal of making a complete and total mess of things. Their intention is not to build something that is practically illegible, impractical to maintain and is limited in scale. But somehow, this is where many inevitably end up. Luckily, all is not lost. With some simple strategies, organizational methods and out-of-the box tools, we can really help get that junk-drawer inline.
For many of us getting started with Sass, at one time or another have created a junk-drawer of files. For most, this was a rookie mistake, but for others, this is a continuing issue with our architecture and file management techniques. Sass doesn't come with any real rules for file management so developers are pretty much left to their own devices.
CSS started out with very simple intentions, but as [tableless web design][1.1] began to really take a foothold, o
class Example.Views.Table extends Backbone.View | |
template: JST['example/table'] | |
initialize: -> | |
@collection.on 'add', @addOne | |
render: -> | |
@$el.html @template() | |
@addAll() | |
@ |