Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.
So now, there's a scribe for that :
# It's only a POC for now | |
defmodule ContextBase do | |
@moduledoc """ | |
Abstracts away common schema functions, such as list, get, create, update, delete, etc. | |
Assumes that the schema module has a `changeset` function. | |
Usage: | |
defmodule MyContext do | |
use ContextBase, repo: MyApp.Repo, schema: MyApp.MySchema | |
end |
#!/bin/bash | |
# Colors | |
RED='\033[0;31m' | |
GREEN='\033[0;32m' | |
NO_COLOR='\033[0m' | |
BLUE='\033[0;34m' | |
YELLOW='\033[0;33m' | |
NO_COLOR='\033[0m' |
Each day at our company, developers are required to document their activities, painstakingly jotting down their daily work and future plans. A monotonous chore that I just really dislike.
So now, there's a scribe for that :
Sometimes we need to add redundancy to some service or server which happen to be a public-facing entry point of our infrastructure. For example, imagine we want to add a high availability pair for a load balancer which sits on the edge of network and forwards traffic to alive backend servers.
┌─────────────┐
│ │
┌─────►│ Backend 1 │
│ │ │
│ └─────────────┘
What you will need: Server behind NAT (Server A), Server with static ip e.g. VPS for hosting Wireguard (Server B). | |
1) On your server B paste this commands in terminal: curl -O https://raw.githubusercontent.com/angristan/wireguard-install/master/wireguard-install.sh && chmod +x wireguard-install.sh && ./wireguard-install.sh | |
2) Create new client and save his ip. Mine will be 10.66.66.123 | |
3) Download this config to server A and connect to your server B with wireguard. | |
4) Depending on your client ip which we configured in step 2 type this commands in server B terminal (this time I wanted my Minecraft server exposed, so I chose 25565 port, yours can depends): | |
sudo iptables -P FORWARD DROP | |
sudo iptables -A FORWARD -i wg0 -o eth0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
sudo iptables -A FORWARD -i eth0 -o wg0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT |
Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct
public static byte[] readUri(Context context, Uri uri) throws IOException { | |
ParcelFileDescriptor pdf = context.getContentResolver().openFileDescriptor(uri, "r"); | |
assert pdf != null; | |
assert pdf.getStatSize() <= Integer.MAX_VALUE; | |
byte[] data = new byte[(int) pdf.getStatSize()]; | |
FileDescriptor fd = pdf.getFileDescriptor(); | |
FileInputStream fileStream = new FileInputStream(fd); | |
fileStream.read(data); |
A file type (with the .dem extension) containing recorded events that can be edited and played back in-game. Demos can be edited to change camera angles, speed up, slow down, play music, and other functions. (from Valve wiki)
### | |
### | |
### UPDATE: For Win 11, I recommend using this tool in place of this script: | |
### https://christitus.com/windows-tool/ | |
### https://github.com/ChrisTitusTech/winutil | |
### https://www.youtube.com/watch?v=6UQZ5oQg8XA | |
### iwr -useb https://christitus.com/win | iex | |
### | |
### |