Skip to content

Instantly share code, notes, and snippets.

View T3sT3ro's full-sized avatar

Tooster T3sT3ro

View GitHub Profile
@T3sT3ro
T3sT3ro / README.md
Last active April 12, 2024 09:30
Linux tips utility for helpful tips in CLI.

Linux tips for bash

Simple utility for managing and printing helpful markdown tips in terminal. Essentially a simple wrapper utility for jq with pretty printing. Anything it does can be done manually on the json file as well. Supports fetching hosted tips and easily sharing knowledge!

Made by Tooster, licensed MIT, full license text at https://mit-license.org/

terminal screenshot

@T3sT3ro
T3sT3ro / pixelart-thumbnailer
Last active January 31, 2024 20:37
thumbnailer setup for displaying pictures + pixelart correctly (not blurred due to filtering) on gnome, ubuntu
#!/bin/bash
# put this in /usr/local/bin/
# must be executable
IMG_URI="$1" # %i
THUMB_SIZE="$2" # %s
THUMB_URI="$3" # %o
IMAGE_SIZE=$(identify -format "%w %h" "$1")
PIX_SIZE=128 # Size to classify as pixel art. Picture must fit inside this box.
@T3sT3ro
T3sT3ro / .bashrc.profiler
Created September 18, 2022 21:16
bash profiling utility - use it as a custom rcfile to get accurate timings for the whole .bashrc loading process
# Based on https://stackoverflow.com/a/20855353/5555799
# Store this file in ~/.bashrc.profiler and add this alias to your .bashrc:
# alias profilebashstartup='exec bash --rcfile ~/.bashrc.profiler'
TRACEFILE=$(mktemp /tmp/trace.XXX)
TIMINGFILE=$(mktemp /tmp/timing.XXX)
STARTTIME=$(date +%s.%N)
exec 3>&2 2> >( tee $TRACEFILE | sed -u 's/^.*$/now/' | date -f - +%s.%N >$TIMINGFILE)
set -x
@T3sT3ro
T3sT3ro / twister.sh
Created September 18, 2022 20:03
skrypt na twistera do basha - działa fajnei w termuxie
#!/bin/bash
# jak podasz pierwszy argument zawierący 'air' to będzie z powietrzem (fiolet)
BODY_T=('LEWA STOPA' 'PRAWA STOPA' 'LEWA RĘKA' 'PRAWA RĘKA')
COLOR_T=(31 32 33 36)
if [[ "$1" =~ .*air.* ]]; then
echo ! GRAMY Z POWIETRZEM \(fioletowy\) !
COLOR_T+=(35); # filoetowy do powietrza
fi
@T3sT3ro
T3sT3ro / renderdoc-how-to.md
Last active March 19, 2024 05:47
describes how to launch renderdoc with java gradle project on minecraft "Create" mod example

So you want to launch RenderDoc with Java, huh?

Here is a good resource to check out first

First of all, check what command is run when you in fact launch your app. For me (Create minecraft mod) this command was executed when I run runClient configuration (line breaks, tabs and backslashes added for readability):

Step 1. command for running minecraft with mods - generated by gradle

/home/tooster/.sdkman/candidates/java/14.0.1-open/bin/java
#!/bin/bash
# Service side git pre-receive hook
# Written by Gautier Pelloux-Prayer <gautier+git@damsy.net>, 2014
#
# Public domain
#
# Simply put this script in server git bare repository <your-git-folder>/hooks and
# apply 'chmod +x pre-receive'.
#

Lista 2 ćwiczenia

1. minimalna ramka

2*2500/10^8 * 10Mb = 500 bit

Mamy rundowy protokół ALOHA we współdzielonym kanale (w każdej rundzie jeden z n uczestników próbuje wysłać ramkę z prawdopodobieństwem p). Jakie jest P(p, n), że jednej stacji uda się nadać (nie wystąpi kolizja)? + Pokazać że P maksymalne dla p=1/n. + Ile wynosi P(1/n, n) dla n->∞ ?

@T3sT3ro
T3sT3ro / sieci.md
Last active March 24, 2019 23:55
sieci 2k19 cheatsheet

Sieci cheatsheet

ogólne

lokalne: local0-7
pary: remote2
czwórki: remote1
wszystkie: remote0

@T3sT3ro
T3sT3ro / SOL13.md
Last active January 29, 2019 15:25
SO lista 13

SO lista 13

  • Tanenbaum (wydanie czwarte): 2.4, 8.1.4, 10.3.4, A 5.2
  • Stallings (wydanie dziewiąte): 9.1, 9.2, 10.1 – 10.3, 10.5
  • Silberschatz (wydanie dziewiąte): 6.6

Zadanie 1. W pewnej chwili do systemu wsadowego przybywają kolejno zadania od P1 do P5. Oszacowany czas działania T w minutach oraz priorytet zadań P wczytano z opisu zadań wsadowych na taśmie magnetycznej i przedstawiono w tabeli poniżej. Zadania ważniejsze mają mniejszy numer priorytetu.

|Zadanie| Czas działania| Priorytet|

/******************************************************************************
* Header file inclusions.
******************************************************************************/
#include "FreeRTOSConfig.h"
// #undef configUSE_TICK_HOOK
// #define configUSE_TICK_HOOK 0
// #undef configQUEUE_REGISTRY_SIZE
// #define configQUEUE_REGISTRY_SIZE 5
#include "FreeRTOS.h"