Skip to content

Instantly share code, notes, and snippets.

View ttys3's full-sized avatar
💭
sad, ttyS0 has been taken by other user

ttys3

💭
sad, ttyS0 has been taken by other user
View GitHub Profile
@ttys3
ttys3 / jpodaudio.go
Created December 23, 2022 14:47 — forked from funayman/jpodaudio.go
Simple JapanesePod101 Audio Downloader
package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
@ttys3
ttys3 / ffmpeg_example.rs
Created September 25, 2022 10:02 — forked from yongkyuns/ffmpeg_example.rs
FFMPEG usage in rust using command and raw pixels
use std::io::prelude::*;
use std::process::{Command, Stdio};
fn main() {
let mut child = Command::new("ffmpeg")
// Overwrite file if it already exists
.arg("-y")
// Interpret the information from stdin as "raw video" ...
.arg("-f")
.arg("rawvideo")
@ttys3
ttys3 / mpv-gnome-inhibit.lua
Created May 8, 2022 04:14 — forked from crazygolem/mpv-gnome-inhibit.lua
Prevent the screen from blanking under GNOME+Wayland while a video is playing
--[[
Prevent the screen from blanking while a video is playing.
This script is a workaround for the GNOME+Wayland issue documented in the
[Disabling Screensaver] section of the mpv manual, and depends on
gnome-session-inhibit (usually provided by the gnome-session package) to set up
the inhibitors.
@ttys3
ttys3 / clean-systemd-logs.sh
Created May 5, 2022 08:09
clean-systemd-logs.sh
#!/bin/sh
# ref https://unix.stackexchange.com/a/457902
journalctl --rotate
journalctl --vacuum-time=1s
@ttys3
ttys3 / fstab-generate-arch.md
Created April 6, 2022 09:37 — forked from Brainiarc7/fstab-generate-arch.md
Generate fstab in Arch Linux

First, install arch-install-scripts:

sudo pacman -S --needed arch-install-scripts

Secondly, mount your partitions in all the internal hard drives.

Thirdly, generate and validate your config by piping it out to stdout:

@ttys3
ttys3 / keyboard-keys.md
Created March 4, 2022 12:37 — forked from bittner/keyboard-keys.md
Keyboard keys markup in MarkDown

Ctrl + Alt + Space

@ttys3
ttys3 / eatmem.c
Last active February 4, 2022 04:26 — forked from pfigue/eatmem.c
Eat Memory. In C. For testing memory limits.
// Compile with e.g. `gcc -o /tmp/eatmem /tmp/eatmem.c`
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#define DEFAULT_SLEEP_SECONDS 600
#define DEFAULT_ALLOC_MB 1024
@ttys3
ttys3 / podman-create-container-via-api.sh
Last active February 3, 2022 08:51
create a podman container with fifo named pipe as log file
#!/bin/sh
# create a podman container with fifo named pipe as log file
# for demonstrate issue https://github.com/containers/podman/issues/13081
CTR_NAME="redis-demo"
function print_title() {
title=$1
echo ""
echo "|=================== $title ===================>>>"