Skip to content

Instantly share code, notes, and snippets.

View offlinehacker's full-sized avatar
🤓
deploying awesomeness

Jaka Hudoklin offlinehacker

🤓
deploying awesomeness
View GitHub Profile
@edolstra
edolstra / nix-lang.md
Last active April 19, 2024 04:04
Nix language changes

This document contains some ideas for additions to the Nix language.

Motivation

The Nix package manager, Nixpkgs and NixOS currently have several problems:

  • Poor discoverability of package options. Package functions have function arguments like enableFoo, but there is no way for the Nix UI to discover them, let alone to provide programmatic ways to
/* Poiščite node.js modul na npmjs.com, ga namestite v okolju runnable.com in ga
uporabite. Naredite funkcijo, ki iz datoteke prebere števila in jih sešteje med seboj.*/
var fs = require('fs');
var numbers = '0, 1, 3.9, -5, 100 \n200, 300 \n-50';
fs.writeFileSync('file', numbers);
function sum(file_name) {
var x = fs.readFileSync(file_name, 'utf-8').split(/[\n,]+/);
return x.reduce(function(a, b){return parseFloat(a) + parseFloat(b)});
@vishvananda
vishvananda / tunnel.sh
Created October 22, 2013 03:16
Script to set up an ipsec tunnel between two machines For Example: ./tunnel.sh 10.10.10.1 10.10.10.2 192.168.0.1 192.168.0.2 would set up an ipsec tunnel over 10.10.10.1 address using 192.168.0.1 as a virtual address passwordless sudo required for user on remote machine
#!/bin/bash
if [ "$4" == "" ]; then
echo "usage: $0 <local_ip> <remote_ip> <new_local_ip> <new_remote_ip>"
echo "creates an ipsec tunnel between two machines"
exit 1
fi
SRC="$1"; shift
DST="$1"; shift