Skip to content

Instantly share code, notes, and snippets.

@peyo22
peyo22 / centos-stream-8-vault-repos.sh
Created November 20, 2024 15:50 — forked from AlexBaranowski/centos-stream-8-vault-repos.sh
Replace CentOS Stream 8 repos with CentOS Stream 8 VAULT repos
cat > /etc/yum.repos.d/CentOS-Stream-AppStream.repo << EOF
# CentOS-Stream-AppStream.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client. You should use this for CentOS updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.
@peyo22
peyo22 / main.c
Created July 6, 2017 19:40 — forked from jeandudey/main.c
GTK borderless window
#include <stdio.h>
#include <gtk/gtk.h>
void hello(GtkWidget* widget, gpointer data)
{
printf("Hello World!\n");
}
int main(int argc, char* argv[])
{
@peyo22
peyo22 / gist:714abea0093a76f4ebfb
Created March 19, 2016 12:17 — forked from jdiscar/gist:9144764
RGB Value to Nearest Color Name (Python)
"""
Original Author Ernesto P. Adorio, Ph.D
Original Source: http://my-other-life-as-programmer.blogspot.com/2012/02/python-finding-nearest-matching-color.html
Modifed By: JDiscar
This class maps an RGB value to the nearest color name it can find. Code is modified to include
ImageMagick names and WebColor names.
1. Modify the minimization criterion to use least sum of squares of the differences.
2. Provide error checking for input R, G, B values to be within the interval [0, 255].
@peyo22
peyo22 / lenovo-mute-tut.md
Created February 23, 2016 23:23 — forked from tybenz/lenovo-mute-tut.md
Enabling mic mute button and light on Lenovo Thinkpads

#####Copied from askubuntu's Enabling mic mute button and light on Lenovo Thinkpad

There are two possible "hardware" indicators (to show that mute is on or off):

The Power button light (green) will blink to show when mute is on The Mic mute button light (orange) will be on or off to show mute status (just like in Windows)

Solution 2 requires a patched thinkpad_acpi kernel module, and is only recommended for advanced users who know what they are doing. This is because the patch is not included by the thinkpad_acpi developers by default, (See this discussion for more details).

###Common Steps

@peyo22
peyo22 / whistle-encode.pl
Created November 18, 2015 13:12 — forked from windytan/whistle-encode.pl
whistle encoder
# windytan's pea whistle encoder
# http://www.windytan.com/2015/10/pea-whistle-steganography.html
use warnings;
use strict;
my $data = $ARGV[0] // "OHAI!";
my $outfile = "whistle.wav";
my $fs = 44100; # sample rate
my $fc = 2600; # whistle pitch