Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000| package main | |
| import ( | |
| "crypto/tls" | |
| "crypto/x509" | |
| "flag" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| ) |
| package main | |
| import ( | |
| "bufio" | |
| "crypto/aes" | |
| "crypto/cipher" | |
| "crypto/rand" | |
| "fmt" | |
| "io" | |
| "io/ioutil" |
| sudo apt-get install connman | |
| After connman was successfully installed trying to scan wifi you will get: | |
| connmanctl> enable wifi | |
| Enabled wifi | |
| connmanctl> scan wifi | |
| Error /net/connman/technology/wifi: No carrier. | |
| Solution is remove wpa_supplicant.conf |
| package main | |
| import ( | |
| "context" | |
| "flag" | |
| "fmt" | |
| "io" | |
| "net" | |
| "net/http" | |
| "os" |
| package main | |
| import ( | |
| "fmt" | |
| "net" | |
| "os" | |
| "time" | |
| ) | |
| func listen(end chan<- bool) { |
Concurrency is a domain I have wanted to explore for a long time because the locks and the race conditions have always intimidated me. I recall somebody suggesting concurrency patterns in golang because they said "you share the data and not the variables".
Amused by that, I searched for "concurrency in golang" and bumped into this awesome slide by Rob Pike: https://talks.golang.org/2012/waza.slide#1 which does a great job of explaining channels, concurrency patterns and a mini-architecture of load-balancer (also explains the above one-liner).
Let's dig in:
| ################## | |
| # sway config file | |
| ################## | |
| set $lock ~/.config/sway/scripts/lock.sh | |
| set $grim ~/.config/sway/scripts/grim.sh | |
| set $slurp ~/.config/sway/scripts/slurp.sh | |
| set $mod Mod4 | |
| set $left h | |
| set $down j | |
| set $up k |
Log into your Raspberry Pi (by ssh for example) or open a terminal window if you are working directly on Pi. In the first step we have to install ddclient, a DynDNS software, on the Pi. For this purpose, the following two commands are necessary.
sudo apt-get update
sudo apt-get install ddclient
Note: During installation an installation wizard opens and wants to know some things from you. Here you can safely enter what you want, because we have to adjust the configuration file manually either way, because the wizard does not support the Namecheap.com interface.
| /** | |
| * MIT License | |
| * | |
| * Copyright (c) 2019 Muhammad Iqbal | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is |