Skip to content

Instantly share code, notes, and snippets.

View Micrified's full-sized avatar
🇫🇷
Collating...

Micrified

🇫🇷
Collating...
  • Rotterdam, Nederlands
View GitHub Profile
@Micrified
Micrified / setuid-doc.md
Created March 12, 2022 09:05
Describes UNIX setuid

SetUID

The setuid feature enables an executable to be run with the effective UID of the file owner. For example, a binary owned by root (passwd) can be run by any user (so they can change their password). Normally, simply giving group-level execution rights isn’t enough. Because while you might be able to run passwd, it will still fail when it tries to modify files not owned by the invoking user.

With setuid, the running process will appear to be running as the file-owner (hence the term effective UID). This ensures that the program can indeed modify files also belonging to the owner. The best-case use for this (and probably most common) is for root, when it wants to make binaries and services available to users like the change-password facility that also must make file-system changes to root owned files.


Command

chmod 4<permissions> <filename> (the 4 prefix means to apply setuid)

Routine

Usually I spend a minimum of 45 minutes to 1:15 in the gym. When I started out, I would spend 1:30. But that's not necessary. Make sure you don't go to the gym low energy. Eat something a little time before so you're energetic.

Core: I always do these (they target chest)

Name Sets Reps/Duration Cooldown Comments
Crunch (bench) 2 15 1-2 minutes Crunch without weight. Stress abs/core. Quite intense but fast
Chest fly 2 10 1-2 minutes Start weight at 30-40kg. Move up or down from there as needed
@Micrified
Micrified / tree.txt
Created July 29, 2021 18:18
Thesis project file tree
├── LICENSE
├── Makefile
├── README.md
├── bib
│   └── Thesis.bib
├── build
│   ├── appendix_a.aux
│   ├── chapter_1.aux
│   ├── chapter_2.aux
│   ├── chapter_3.aux
@Micrified
Micrified / imx6ul-imx6ull-var-som-concerto-board.patch
Created May 31, 2021 08:13
Patch file for the concerto board display
--- imx6ul-imx6ull-var-som-concerto-board.dtsi 2021-05-31 09:51:50.000000000 +0200
+++ imx6ul-imx6ull-var-som-concerto-board.dtsi.patch 2021-05-31 10:08:44.000000000 +0200
@@ -254,21 +254,21 @@
status = "okay";
display0: display {
- bits-per-pixel = <16>;
+ bits-per-pixel = <24>;
bus-width = <24>;
@Micrified
Micrified / Dockerfile
Created April 28, 2021 15:30
Docker container for Hedon
# Dockerfile for Hedon Embedded Linux applications
# Ubuntu version (Select in accordance with Variscite Yocto ~ 5.4 Zeus)
FROM ubuntu:18.04
# Export environment variable for time zone
#RUN DEBIAN_FRONTEND="noninteractive" TZ="Europe/Amsterdam" apt-get -y install tzdata
ENV DEBIAN_FRONTEND "noninteractive"
ENV TZ "Europe/Amsterdam"
# Requied packages for installing Yocto (see MegaManual section 1.2.1)
@Micrified
Micrified / data.csv
Created March 23, 2021 12:40
Data file
0.000000 0.031550 0.000000 0.217320 0.036452 0.145327 0.000000 0.100000
1.000000 0.011040 0.000000 0.080356 0.014099 0.050552 0.000000 0.100000
2.000000 0.020467 0.000000 0.081340 0.036603 0.057728 0.000000 0.100000
3.000000 0.012152 0.000000 0.423907 0.015460 0.113067 0.000000 0.100000
4.000000 0.024790 0.000000 0.089054 0.060153 0.072631 0.000000 0.100000
0.000000 0.031550 1.000000 0.140355 0.046335 0.104273 0.000000 0.100000
1.000000 0.011040 1.000000 0.093376 0.015811 0.050407 0.000000 0.100000
2.000000 0.020467 1.000000 0.089869 0.023141 0.054102 0.000000 0.100000
3.000000 0.012152 1.000000 0.085967 0.016273 0.064607 0.000000 0.100000
4.000000 0.024790 1.000000 0.074587 0.034944 0.051891 0.000000 0.100000
@Micrified
Micrified / scheduler_overhead.csv
Created February 8, 2021 16:04
Scheduler overhead for both the producer-consumer executor (1) and standard executor (0). Time in microseconds (col 2)
1 28029
1 9031
1 36304
1 9274
1 6286
1 1152088
1 7930
0 73239
0 60186
0 7936
@Micrified
Micrified / data2.csv
Created January 29, 2021 10:36
R data file (Chain 0 WCRT)
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 18 columns, instead of 12 in line 6.
3.06592,1.6141,1.82322,4.8211,0.132003,0.394334,0.215964,0.286638,0.350216,1.039704,0.195282,0.35774,0.517813,1.58086,0.446634,0.615486,0.138665,0.228693
0.284414,0.545356,0.325989,0.609591,0.61266,2.39916,0.331273,0.559434,0.213936,0.365348,0.93822,3.30502,0.367724,0.997512,0.296118,0.576547,1.16456,2.46389
1.939493,3.460967,2.57222,2.09248,1.103233,1.699593,0.427933,0.590976,0.151645,0.593852,0.318007,0.658005,0.251167,0.61534,0.104106,0.202359,0.313771,0.808031
0.615779,0.732675,0.217291,0.293927,0.209549,0.466901,0.31096,0.4585,0.07723,0.347473,0.310075,0.74919,0.242618,0.570051,0.14172,0.371374,0.122402,0.299619
0.741617,0.7876,0.181422,0.403508,0.87666,2.33649,0.29546,0.28656,1.09835,2.74068,0.182584,0.351186,0.78256,3.08914,1.2002,5.13452,0.411056,0.138814
0.383244,0.561088,1.67152,3.3699,0.523737,0.589011,0.500036,1.433364,0.84913,1.72567,0.100457,0.327367,0.495676,0.741284,0.153449,0.495438,0.211128,0.736556
0.234698,0.044469,0.50662,0.95738,0.3419,0.52319,0.3933,0.954133,0.096152,0.435787,0.18827,0.
@Micrified
Micrified / data.csv
Created January 24, 2021 18:05
R data file
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 18 columns, instead of 11 in line 6.
0.60443,0.674045,0.554972,0.551437,0.349373,0.13083,0.341579,0.366693,0.232248,0.818848,0.493217,0.401549,1.0482,2.29177,0.320231,0.632207,0.488445,0.303692
0.60428,0.75428,0.59257,3.30913,0.403928,0.543608,0.376744,0.154088,0.441327,0.6287,0.411764,0.213774,0.222906,0.349853,0.533779,0.408019,0.502975,0.388311
0.526314,0.639937,0.626341,0.329788,0.342706,0.24246,1.97612,3.04372,0.344055,0.72419,0.428796,0.976996,0.221763,0.619815,0.4718,0.392767,0.418833,0.262506
1.50809,0.65293,0.42971,0.495674,0.496227,0.787973,0.390459,0.530087,0.582217,0.579977,0.590395,0.812478,0.61932,0.603849,0.585751,0.718264,0.497125,0.845155
0.179008,0.10614,0.423271,0.688405,0.425254,0.20317,0.360248,0.686564,0.287085,0.75817,0.48264,2.87805,0.57792,1.65253,1.3408,6.02136,0.350399,0.357304
0.64332,0.48074,0.251354,0.693357,0.60369,1.813865,0.682184,0.640694,0.19655,0.813595,0.28554,0.79141,0.396304,0.645476,0.382084,0.549818,0.35252,3.11737
0.201144,0.298691,0.439604,0.378664,0.449122,0.431693,0.32416,0.537798,0.300573,0.200067,0.
@Micrified
Micrified / snippet.c
Created September 22, 2020 21:46
Packet processing
recv_result recv_msg_queue (queue *rqp, msg_type *tp, void *msg_data_p) {
static unsigned char buffer[MSG_MAX_SIZE];
static msg_type t;
static automaton_recv_state state = STATE_RECV_MARKERS;
static int markers = 0;
static off_t offset = 0;
static ssize_t payload_size = 0;
int exists_pending_data = 0, msg_is_valid;
unsigned char c;