Skip to content

Instantly share code, notes, and snippets.

View ghedo's full-sized avatar
:shipit:
🔥 This is fine 🔥

Alessandro Ghedini ghedo

:shipit:
🔥 This is fine 🔥
View GitHub Profile
@ghedo
ghedo / movie_time.c
Last active July 2, 2021 12:56
Utility to hide the mouse cursor and prevent screen blanking (http://blog.ghedini.me/post/2050358022/screensaver-inhibitor)
/*
* Utility to hide the mouse cursor and prevent screen blanking.
*
* Compile:
* $ cc -o movietime movie_time.c -lX11
*
* Usage:
* $ ./movietime
*
* Copyright (C) 2010 Alessandro Ghedini <alessandro@ghedini.me>
ASM=nasm
ISO=genisoimage -input-charset utf-8 -boot-load-size 4 -no-emul-boot -r
all: boot.iso
boot.bin: boot.asm
$(ASM) -o boot.bin boot.asm
boot.iso: boot.bin
mkdir iso/
@ghedo
ghedo / Makefile
Last active January 13, 2022 13:22
Kernel module to disable the ptrace() system call (http://blog.ghedini.me/post/10240771002/kernel-module-to-disable-ptrace)
# Copyright (C) 2011 Alessandro Ghedini <alessandro@ghedini.me>
# Updated 2012 by Mike Perry to extract syscall table addresses
# Updated 2014 by Francis Brosnan Blázquez to check for ia32 support
obj-m += noptrace2.o
KERNEL_VER=$(shell uname -r)
SCT := $(shell grep " sys_call_table" /boot/System.map-$(KERNEL_VER) | awk '{ print $$1; }')
SCT32 := $(shell grep "ia32_sys_call_table" /boot/System.map-$(KERNEL_VER) | awk '{ print $$1; }')
@ghedo
ghedo / wr
Last active October 26, 2015 03:28
Translate a word using wordreference.com
#!/usr/bin/perl
# Usage: wr <term> [<dict>]
# Translate a word using wordreference.com
use strict;
use warnings;
use feature qw(say);
@ghedo
ghedo / mouse_wrap.c
Last active July 2, 2021 11:58
Wrap mouse pointer at screen edges
/*
* Wrap mouse pointer at screen edges.
*
* Compile:
* $ cc -o mousewrap mouse_wrap.c -lX11 -lXi
*
* Usage:
* $ ./mwrap
*
* Copyright (C) 2012 Alessandro Ghedini <alessandro@ghedini.me>
@ghedo
ghedo / sleepd.c
Last active July 5, 2020 10:21
Execute a command after some time of inactivity
/*
* Execute a command after some time of inactivity
*
* Compile:
* $ cc -o sleepd sleepd.c
*
* Usage:
* $ ./sleepd -t 600 -c "slock"
*
* NOTE: to run this as a normal (non-root) user you may need to change
@ChrisK2
ChrisK2 / README.md
Last active August 29, 2015 14:07
ytdl_hook.lua

youtube-dl hook script for mpv

Now part of mpv

As of 079ecd7 (2014-11-19), the hook script is now integrated into mpv and will be avaiblable when compiled with LUA support. It is (currently) disabled by default, to enable it add --ytdl=yes to your command-line or ytdl=yes to your mpv.conf.

Open Issues