Skip to content

Instantly share code, notes, and snippets.

View sant123's full-sized avatar
🇨🇴

Santiago Aguilar Hernández sant123

🇨🇴
  • Gorilla Logic
  • Colombia
View GitHub Profile
@sant123
sant123 / 51-udisks2.rules
Last active September 26, 2024 03:17
Automount usb devices with systemd and udisks2
// Allow "your_user" to mount drives without authentication
polkit.addRule(function (action, subject) {
const isAction = action.id == "org.freedesktop.udisks2.filesystem-mount" ||
action.id == "org.freedesktop.udisks2.filesystem-unmount" ||
action.id == "org.freedesktop.udisks2.filesystem-mount-other-seat";
if (isAction && subject.user == "your_user") {
return polkit.Result.YES;
}
Computer Information:
Manufacturer: Gigabyte Technology Co., Ltd.
Model: B150M-D3H-CF
Form Factor: Desktop
No Touch Input Detected
Processor Information:
CPU Vendor: GenuineIntel
CPU Brand: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
CPU Family: 0x6
export * from "https://deno.land/x/nano_jsx@v0.0.30/mod.ts";
import {
Helmet,
renderSSR as nanoRender,
} from "https://deno.land/x/nano_jsx@v0.0.30/mod.ts";
import { setup } from "https://esm.sh/twind@0.16.16";
import {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
static char *read_stdin(void)
{
size_t cap = 4096, /* Initial capacity for the char buffer */
len = 0; /* Current offset of the buffer */
char *buffer = malloc(cap * sizeof(char));
@sant123
sant123 / readin.c
Last active June 17, 2020 02:08 — forked from 1995eaton/readin.c
C stdin reader example with dynamic memory allocation
#include <stdio.h>
#include <stdlib.h>
static char *read_stdin(void)
{
size_t cap = 4096, /* Initial capacity for the char buffer */
len = 0; /* Current offset of the buffer */
char *buffer = malloc(cap * sizeof(char));
int c;