Skip to content

Instantly share code, notes, and snippets.

@kingsd041
kingsd041 / rke2-commands.md
Created September 3, 2021 07:41 — forked from superseb/rke2-commands.md
RKE2 / rancherd commands

RKE2 commands

Install

curl -sL https://get.rke2.io | sh
systemctl daemon-reload
systemctl start rke2-server
@Pulimet
Pulimet / AdbCommands
Last active May 6, 2024 21:19
Adb useful commands list
adb help // List all comands
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
@JiayinCao
JiayinCao / tiny_fiber.h
Last active May 6, 2024 21:19
Tiny Fiber ( A razor thin cross platform fiber library )
/*
MIT License
Copyright (c) 2023 Jiayin Cao
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
@MatthewVance
MatthewVance / unbound.conf
Last active May 6, 2024 21:18
Config for running Unbound as a caching DNS forwarder (performance settings optimized for Raspberry Pi 2).
server:
###########################################################################
# BASIC SETTINGS
###########################################################################
# Time to live maximum for RRsets and messages in the cache. If the maximum
# kicks in, responses to clients still get decrementing TTLs based on the
# original (larger) values. When the internal TTL expires, the cache item
# has expired. Can be set lower to force the resolver to query for data
# often, and not trust (very large) TTL values.
cache-max-ttl: 86400
@tsh-code
tsh-code / du.sh
Created May 18, 2019 13:55
Find largest modules
du -sh ./node_modules/* | sort -nr | grep '\dM.*'
@alaminfirdows
alaminfirdows / Bengali.php
Created July 9, 2019 13:02
Laravel Bangla Date, Time and Number
<?php
class Bengali
{
// Numbers
public static $bn_numbers = ["", "", "", "", "", "", "", "", "", ""];
public static $en_numbers = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "0"];
// Months
public static $en_months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
public static $en_short_months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
@yuezhu
yuezhu / haproxy.cfg
Last active May 6, 2024 21:14
HAProxy config for HTTPS transmission web interface
global
maxconn 16384
log 127.0.0.1 len 8192 local0
log-send-hostname
chroot /var/lib/haproxy
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
stats timeout 30s
user haproxy
group haproxy
daemon
@primaryobjects
primaryobjects / m3u8.md
Last active May 6, 2024 21:14
How to download m3u8 and ts video movie streams.

m3u8 Downloading

  1. Open Chrome Developer tools and click the Network tab.
  2. Navigate to the page with the video and get it to start playing.
  3. Filter the list of files to "m3u8".
  4. Find master.m3u8 or index.m3u8 and click on it.
  5. Save the file to disk and look inside it.
  6. If the file contains a single m3u8 master url, copy that one instead.
  7. Run the program m3u8x.
  8. Paste the same m3u8 url in both textboxes (URL and Quality URL) and click "Headers" and set the referral url and user-agent from the request as found in Chrome.
@alvarogfn
alvarogfn / useElementLineCount.ts
Created May 6, 2024 21:09
Hook que computa quantidade de linhas de um element com lineClamp
import { useEffect, useRef, useState } from 'react'
const countElementLines = (target: HTMLElement) => {
const style = window.getComputedStyle(target, null)
const fontSize = parseInt(style.getPropertyValue('font-size'))
let height = parseInt(style.getPropertyValue('height'))
const boxSizing = style.getPropertyValue('box-sizing')
if (boxSizing === 'border-box') {
@TJ-developer
TJ-developer / renew_ssl_cert.yaml
Last active May 6, 2024 21:08
Homeassistant Blueprint for SSL-Certificate renewal
blueprint:
name: Renew Let's Encrypt Certificate
description: Renew Certificate when due date is below given value
domain: automation
input:
cert_expiry_sensor:
name: Certificate Expiry Sensor
description: Sensor from the Certificate Expiry Integration (https://www.home-assistant.io/integrations/cert_expiry)
selector:
entity: