This is a tutorial that teaches you how to create your own simple file-sharing service. It works in the terminal.
Usage:
$ share ~/pictures/my-funny-kitten.png
http://files.YOURDOMAIN.com/my-funny-kitten.png| # Download latest archlinux bootstrap package, see https://www.archlinux.org/download/ | |
| wget http://ftp.nluug.nl/os/Linux/distr/archlinux/iso/2016.01.01/archlinux-bootstrap-2016.01.01-x86_64.tar.gz | |
| # Make sure you'll have enough entropy for pacman-key later. | |
| apt-get install haveged | |
| # Install the arch bootstrap image in a tmpfs. | |
| mount -t tmpfs none /mnt | |
| cd /mnt | |
| tar xvf ~/archlinux-bootstrap-2016.01.01-x86_64.tar.gz --strip-components=1 |
| #!/bin/bash | |
| set -x | |
| WARNDAYS=30 | |
| PANICDAYS=6 | |
| DOMAIN_LIST_URL=https://raw.githubusercontent.com/skopjehacklab/dns-zone-files/master/ssl/list_of_ssl_enabled_domains.txt | |
| WARNSECONDS=$(($WARNDAYS * 24 * 60 * 60)) | |
| PANICSECONDS=$(($PANICDAYS * 24 * 60 * 60)) |
| #include <sys/capability.h> | |
| #include <sys/types.h> | |
| #include <unistd.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| int | |
| main(void) { | |
| pid_t pid; | |
| cap_t cap; |
| urls = ["http://www.google.com", "http://www.bing.com", "http://www.yahoo.com"] | |
| for_tasks = for {url, i} <- Enum.with_index(urls) do | |
| Task.async(fn -> | |
| :timer.sleep(3000 * i) | |
| IO.puts("for ##{i}: #{url}") | |
| end) | |
| end | |
| map_tasks = urls |
| import pycurl | |
| import json | |
| import time | |
| from StringIO import StringIO | |
| i = 0 | |
| bnums = [] | |
| while True : | |
| print(str(i)) |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
Do it in any language you want to learn. The prize is knowledge!
Some of the more interesting would be Erlang, Elixir, Lua, Rust, Go, Haskell, Ocaml, but also anything more exotic than theese (OTOH an PHP version would be really crazy exotic for this kind of an app).
Connects to gtalk as an xmpp or hangouts (protobufs) client. Connects to my prosody as an xmpp component and forwards messages to my one single account.
| defmodule Boydm.Utilities.Map do | |
| #============================================================================ | |
| # similar to List.meyers_difference, the below code compares two maps | |
| # and generates a list of actions that can be applied to the first map | |
| # to transform it into the second map. | |
| #-------------------------------------------------------- | |
| def difference(map_1, map_2) when is_map(map_1) and is_map(map_2) do | |
| # remove any keys from map_1 that are simply not present (at all) in map_2 |
| language: elixir | |
| elixir: 1.5.2 | |
| otp_release: '19.0' | |
| script: | |
| - mix test && ./deploy.sh |