Skip to content

Instantly share code, notes, and snippets.

@Janiczek
Janiczek / elm-build-cache.mjs
Last active February 4, 2022 00:39
Build ~/.elm cache manually without checking SHA1 hashes
#!/usr/bin/env node
// the .mjs extension is important
// run this inside the directory containing the `elm.json` file
// (if it's not executable, run `chmod +x elm-build-cache.mjs`)
// with VERBOSE=1 env var it will show you results of the exec commands
import fs from 'fs/promises';
import {exec} from 'child_process';
@chiroptical
chiroptical / babyShark.hs
Last active February 3, 2023 15:23
Baby shark as a Haskell program
{-# LANGUAGE BlockArguments #-}
module Main where
main :: IO ()
main = do
babyShark
do do do do do do babyShark
do do do do do do babyShark
do do do do do do babyShark
@iffa
iffa / ax201-hostapd.conf
Created June 1, 2021 10:29
hostapd config for Intel WiFi6 AX201 (5Ghz)
# Config for Intel WiFi6 AX201
ctrl_interface=/var/run/hostapd
ctrl_interface_group=0
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=1
ssid=AwesomeWifi
@TheComputerGuy96
TheComputerGuy96 / waylandgamelist.md
Last active November 9, 2020 10:32
List of games that support Wayland (WIP)

List of games that support Wayland with minimal setup

  • SuperTuxKart (note 1)
  • Xonotic (note 1)
  • osu!lazer (note 1)

List of games that require library changes for Wayland support

  • Minecraft Java Edition (1.13+) (note 2)

List of games that require both library and game code changes for Wayland support

  • Minecraft Java Edition (pre-1.13) (note 2)
#!/usr/bin/env sh
set -o errexit
VOLUMES=($(lsblk -npo KNAME | grep -v 'loop\|sr'))
SIZES=($(lsblk -npo KNAME,SIZE | grep -v 'loop\|sr' | awk 'BEGIN {FS=" "}; {print $2}'))
COUNT=$(lsblk -n | grep -v 'loop\|sr' | wc -l)
RADIOLIST=()
for i in $(seq 0 $(expr $COUNT - 1));
do
@caadar
caadar / autologin-tty-nixos.org
Last active October 23, 2023 00:34
How to make a user autologin at the console on NixOS

Autologin a user at the console (NixOS)

Problem

NixOS provide services.mingetty.autologinUser option, but it can’t be used for the specific TTY.

Minimal working example

TTY1 and user “guest”:

@BangL
BangL / syncrepo.sh
Last active November 10, 2020 03:58
chaotic-aur mirroring script
#!/bin/bash
target="/home/chaotic/http/chaotic-aur"
tmp="/home/chaotic/tmp"
lock="/home/chaotic/syncrepo.lck"
bwlimit=0
source_url='rsync://lonewolf.pedrohlc.com/chaotic-aur/'
lastupdate_url='https://lonewolf.pedrohlc.com/chaotic-aur/lastupdate'
@thotypous
thotypous / unisolate.sh
Created December 7, 2018 12:13
Contorna o isolamento entre diferentes computadores na rede eduroam da UFSCar
#!/bin/bash
gw="$(ip route | grep -Po '^default via \K\d+\.\d+\.\d+\.\d+')"
iface="$(ip route | grep -Po '^default via \d+\.\d+\.\d+\.\d+ dev \K[^ ]+')"
local_subnet_forwarding_rule="$(ip route | grep -P "^\d+\.\d+\.\d+\.\d+/\d+ dev $iface .*? link src")"
gw_forwarding_rule="$gw $(echo "$local_subnet_forwarding_rule" | grep -Po '^\d+\.\d+\.\d+\.\d+/\d+ \K.+')"
if [[ ! -z "$local_subnet_forwarding_rule" ]]; then
set -xe
@thotypous
thotypous / exemplo_fluxo_quebrado_cliente.py
Last active September 16, 2018 16:17
Exemplos de implementação de camada de aplicação sobre TCP
#!/usr/bin/python3
# -*- encoding: utf-8 -*-
import socket
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('endereco', 8000))
s.send(b'A'*50000 + b'F')
s.close()
@Keenuts
Keenuts / readme.md
Last active August 13, 2023 11:59
GSoC 2018 | Vulkan-ize VirGL

GSoC 2018 | Vulkan-ize VirGL

GSoC 2018 is coming to an end. This GIST will present you this project in its current state (August 10, 2018).

Current state

We can run a sample vulkan compute application, R/W data to/from the server, and execute a compute shader.

Project links