Skip to content

Instantly share code, notes, and snippets.

View filipsPL's full-sized avatar
💭
🚀 travelling to Mars and back

filips filipsPL

💭
🚀 travelling to Mars and back
View GitHub Profile
@benhoyt
benhoyt / markov.py
Created November 11, 2023 15:45
Generate text from an input using a simple Markov chain generator
import collections, random, sys, textwrap
# Build possibles table indexed by pair of prefix words (w1, w2)
w1 = w2 = ''
possibles = collections.defaultdict(list)
for line in sys.stdin:
for word in line.split():
possibles[w1, w2].append(word)
w1, w2 = w2, word
@rail01
rail01 / Public_Polish_NTP_Servers.md
Last active June 12, 2024 08:11
List of publickly accessible NTP time servers in Poland

Below is the list of publickly accessible NTP time servers located in Poland, along with their hostnames, IP addresses, Stratum levels, AS numbers and contact information.

List consists of trustworthy sources such as government agencies, scientific organizations, ISPs or major infrastructure providers. STRATUM 1 and 2.

If you're looking to use any of those NTP servers in business-critical production environment, please consider obtaining time from a time source directly, e.g. via GPS receiver or caesium atomic clock.

List

Host organization Hostname(s) IPv4 IPv6 STRATUM ASN Contact information
Główny Urząd Miar (Central Office of Measures) tempus1.gum.gov.pl tempus2.gum.gov.pl 194.146.251.100 194.146.251.101 N/A 1 AS50606 time@gum.gov.pl
@wolfiestyle
wolfiestyle / conky.conf
Created November 10, 2020 17:27
Conky config for amdgpu
${alignc}${font Dejavu Sans Mono:size=8}GPU ${exec cat /sys/class/drm/card0/device/gpu_busy_percent}%${font}
${color3}${execgraph "cat /sys/class/drm/card0/device/gpu_busy_percent" 3fa5ff 3fa5ff}
${color1}Temp${color} ${hwmon 2 temp 1}
${color1}GPU clk${color} ${exec grep -Po '\d+:\s\K(\d+)(?=.*\*$)' /sys/class/drm/card0/device/pp_dpm_sclk}
${color1}Mem clk${color} ${exec grep -Po '\d+:\s\K(\d+)(?=.*\*$)' /sys/class/drm/card0/device/pp_dpm_mclk}
${color1}Mem${color} ${exec numfmt --to=iec < /sys/class/drm/card0/device/mem_info_vram_used}
${color1}Fan${color} ${hwmon 2 fan 1}
#include "Arduino.h"
#include "esp_camera.h"
#include "ESPAsyncWebServer.h"
typedef struct {
camera_fb_t * fb;
size_t index;
} camera_frame_t;
#define PART_BOUNDARY "123456789000000000000987654321"
@mwaskom
mwaskom / palettes.png
Last active July 9, 2024 20:35
Show all seaborn palettes and simulate what they look like with various color vision deficiencies. (The 10-element seaborn palettes will be part of the forthcoming 0.9 release).
palettes.png
@shrayasr
shrayasr / fu-garmin-bulk-delete.js
Created March 28, 2018 06:03
Bulk delete activities in Garmin Connect
function foo() {
console.log("foo - start")
$("button.search-button").click()
setTimeout(function() {
var li = $(".list-item")[0]
var delButton = $(li).find("button.js-activity-delete")
var confirmDelButton = $(li).find("button.delete-yes")
console.log(delButton, confirmDelButton)
@pyksid
pyksid / watchdog.sh
Last active January 5, 2022 12:31
openwrt watchdog: interface auto reconnect
#!/bin/sh
ip1=8.8.8.8
ip2=208.67.222.222
tries=3
if [[ -z $1 ]]; then
logger -t watchdog "Missing interface name"
exit 1
fi
@fawkesley
fawkesley / randomize-mac-addresses.sh
Last active July 25, 2022 06:24
In Ubuntu 16.04, randomize WiFi MAC addresses with a daily rotation - /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
#!/bin/sh
# /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
# INSTALL
#
# > curl -L 'https://gist.github.com/paulfurley/46e0547ce5c5ea7eabeaef50dbacef3f/raw/56ee5dd5f40dec93b8f7438cbdeda5475ea3b5d2/randomize-mac-addresses.sh' |sudo tee /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
# > sudo chmod +x /etc/NetworkManager/dispatcher.d/pre-up.d/randomize-mac-addresses.sh
# Configure every saved WiFi connection in NetworkManager with a spoofed MAC
@Hermanio
Hermanio / thermal-conf.xml
Last active April 23, 2023 14:59
A working thermald configuration file for Thinkpad T430 with a trip point of 90C.
<?xml version="1.0"?>
<ThermalConfiguration>
<Platform>
<Name>T430</Name>
<ProductName>*</ProductName>
<Preference>QUIET</Preference>
<ThermalSensors>
<ThermalSensor>
<Type>pkg-temp-0</Type>
<Path>/sys/class/thermal/thermal_zone0/temp</Path>
@maxwelleite
maxwelleite / ttf-ms-tahoma-installer.sh
Last active May 16, 2024 06:43
Script to install the original Microsoft Tahoma font on Ubuntu distros
#!/bin/bash
# Author: Maxwel Leite
# Website: http://needforbits.wordpress.com/
# Description: Script to install the original Microsoft Tahoma Regular and MS Tahoma Bold (both version 2.60) on Ubuntu distros.
# Dependencies: wget and cabextract
# Tested: Ubuntu Saucy/Trusty/Xenial/Bionic
output_dir="/usr/share/fonts/truetype/msttcorefonts/"
tmp_dir="/tmp/ttf-ms-tahoma-installer"