I use Ubuntu’s Uncomplicated firewall because it is available on Ubuntu and it's very simple.
if ufw is not installed by default be sure to install it first.
dash_id=xxxx | |
api_key=xxx | |
app_key=xxx | |
# 1. export | |
curl -X GET "https://app.datadoghq.com/api/v1/dash/${dash_id}?api_key=${api_key}&application_key=${app_key}" > dash.json | |
# 2. edit dash.json | |
move "graphs", "title", "description" up one level in the json hierarchy, from being beneath "dash" to being at the same level |
func ip2int(ip net.IP) uint32 { | |
if len(ip) == 16 { | |
return binary.BigEndian.Uint32(ip[12:16]) | |
} | |
return binary.BigEndian.Uint32(ip) | |
} | |
func int2ip(nn uint32) net.IP { | |
ip := make(net.IP, 4) | |
binary.BigEndian.PutUint32(ip, nn) |
import "sort" | |
ages := map[string]int{ | |
"a": 1, | |
"c": 3, | |
"d": 4, | |
"b": 2, | |
} | |
names := make([]string, 0, len(ages)) |
#include <uapi/linux/if_ether.h> | |
#include <uapi/linux/in.h> | |
#include <uapi/linux/ip.h> | |
#include <uapi/linux/tcp.h> | |
int drop_ipv4_tcp_80(struct xdp_md *ctx) { | |
void *data = (void *)(long)ctx->data; | |
void *data_end = (void *)(long)ctx->data_end; | |
struct ethhdr *eth; |
Run the following in powershell as admin
Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Windows-Subsystem-Linux
Install a distro (ex: Ubuntu 18.04 LTS - https://www.microsoft.com/store/apps/9N9TNGVNDL3Q)
Open your distro you installed via the start menu, let it setup
Update and upgrade
sudo apt-get update
[alias] | |
wip = for-each-ref --sort='authordate:iso8601' --format=' %(color:green)%(authordate:relative)%09%(color:white)%(refname:short)' refs/heads | |
Running any intensive job immediately throttles the CPU to 400Mhz! I found this:
https://www.reddit.com/r/thinkpad/comments/pvb87e/thinkpad_p14s_gen_2_intel_fix_for_aggressive_cpu/
which sent me to https://forums.lenovo.com/t5/Other-Linux-Discussions/X1C6-T480s-low-cTDP-and-trip-temperature-in-Linux/m-p/4028489?page=40#5069052 which explained there are actual Fn keys for this!
Can you check something for me. Do:
cat /sys/devices/virtual/powercap/intel-rapl-mmio/intel-rapl-mmio:0/constraint_0_power_limit_uw