Just follow the guide at https://linuxconfig.org/ubuntu-20-04-system-monitoring-with-conky-widgets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [dependencies] | |
// async-std = { version = "1.7.0", features = ["unstable"]} | |
// surf = "1.0.0" | |
pub async fn many_requests(urls: &[String]) -> Vec<Result<String, surf::Exception>> { | |
let client = surf::Client::new(); | |
let mut handles = vec![]; | |
for url in urls { | |
let request = client.get(&url).recv_string(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Just a way to host my images... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#define SIZE(arr) (sizeof(arr) / sizeof((arr)[0])) | |
void arr_iter(const short[], short); | |
void in_place_mod(short[], short, unsigned int); | |
int main(void) { | |
short numsArr[] = {1, 2, 3, 4}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/env/python3 | |
# https://gist.github.com/EONRaider/d6041f6c5845f9b8e726bed33d09c6c6 | |
__author__ = 'EONRaider, keybase.io/eonraider' | |
from socket import socket | |
def get_request(hostname: str, path: str = None, port: int = 80, | |
encoding: str = 'utf_8'): | |
path = path if path is not None else '/' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# https://gist.github.com/EONRaider/35484fc55c643ddbdac7ae55f919419d | |
__author__ = 'EONRaider, keybase.io/eonraider' | |
def translate_tcp_flags(flag_code: str, *, base: int): | |
flag_names = 'NS', 'CWR', 'ECE', 'URG', 'ACK', 'PSH', 'RST', 'SYN', 'FIN' | |
flag_bits = format(int(flag_code, base=base), '09b') | |
yield from (flag_name for flag_name, flag_bit in zip(flag_names, flag_bits) | |
if flag_bit == '1') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# https://gist.github.com/EONRaider/32c5dbf467c786f393bd0e7601246ddf | |
__author__ = 'EONRaider @ keybase.io/eonraider' | |
""" | |
A low-level network sniffer for TCP/IP packets. | |
""" | |
import struct | |
from binascii import hexlify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# https://gist.github.com/EONRaider/a59d6c4636c1211c7a854c384ddf19a0 | |
__author__ = 'EONRaider, keybase.io/eonraider' | |
import argparse | |
import ipaddress | |
try: | |
from scapy.all import * | |
from scapy.layers.inet import ICMP, IP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# https://gist.github.com/EONRaider/f2284ccf75613c8751e20062b9e750f3 | |
__author__ = 'EONRaider, keybase.io/eonraider' | |
try: | |
import netifaces | |
except ModuleNotFoundError as e: | |
raise SystemExit(f"Requires {e.name} module. Run 'pip install {e.name}' " | |
f"and try again.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# https://gist.github.com/EONRaider/3b7a8ca433538dc52b09099c0ea92745 | |
__author__ = 'EONRaider, keybase.io/eonraider' | |
import fcntl | |
import socket | |
import struct | |
try: | |
from netifaces import AF_INET, ifaddresses |
NewerOlder