Skip to content

Instantly share code, notes, and snippets.

View rellfy's full-sized avatar

Lorenzo Fontoura rellfy

View GitHub Profile
@rellfy
rellfy / start_with_env.sh
Created May 2, 2022 07:21
Start program with environment variables from file
set -o allexport
source /root/.env
set +o allexport
/root/program
@rellfy
rellfy / forever.service
Created May 1, 2022 14:32
Linux service
[Unit]
Description=A linux service, located on /etc/systemd/system/<NAME>.service, that forever attempts to restart itself after 1s.
[Service]
User=root
ExecStart=/bin/bash -c "echo 'who is a good service? i am a good service'"
Restart=always
RestartSec=1
StartLimitInterval=0
#include <stdio.h>
#include <stdlib.h>
void *getlines(char *file);
int main(int argc, char **argv) {
if (argc != 2) {
printf("usage: <file>\n");
return 1;
}
@rellfy
rellfy / ms.js
Created February 1, 2019 15:52
Discord minesweeper generator
var width; // set by calling "init"
var total; // set by calling "init", total n of mines
var mines; // set by calling "init"
var adjacent = new Array(); // count of adjacent mines
var mine = 9; // adjacency count for a mine
var exposed = new Array(); // exposure state / pending exposures
var listEnd = -1; // end marker in "exposed"

Keybase proof

I hereby claim:

  • I am rellfy on github.
  • I am rellfy (https://keybase.io/rellfy) on keybase.
  • I have a public key whose fingerprint is 9CCE BAD3 77F4 2BFA EC28 5463 AF6B 3077 E602 B7A7

To claim this, I am signing this object: