Skip to content

Instantly share code, notes, and snippets.

View lae's full-sized avatar

只今立ち去った存在です lae

View GitHub Profile
@bluecmd
bluecmd / convert.sh
Last active April 5, 2023 20:05
Converting boot logo to EDK2 BMP format
# Convert a 24-bit BMP to EDK2 style BMP
# Something like 400x400 is probably the largest realistic image to use
# 300x300 looks pretty neat.
convert ~/KamelLogo.bmp -compress None -type Palette BMP3:./edk2/MdeModulePkg/Logo/Logo.bmp
@hangxingliu
hangxingliu / github-markdown-print.js
Created May 23, 2018 19:26
GitHub Markdown Print Script
// Refrence from: https://gist.github.com/beevelop/a0f2c76e79610dca01550c9a93f83876
// Copy following scripts in the developer console of page included markdown content you want to print:
(function () {
var $ = document.querySelector.bind(document);
$('#readme').setAttribute('style', 'position:absolute;top:0;left:0;right:0;bottom:0;z-index:100;background-color:white');
$('#readme>article').setAttribute('style', 'border: none');
$('body').innerHTML = $('#readme').outerHTML;
window.print();
})();
@drmalex07
drmalex07 / README-python-service-on-systemd-activated-socket.md
Last active January 13, 2024 12:53
An example network service with systemd-activated socket in Python. #systemd #python #socket #socket-activation

README

The example below creates a TCP server listening on a stream (i.e. SOCK_STREAM) socket. A similar approach can be followed to create a UDP server on a datagram (i.e. SOCK_DGRAM) socket. See man systemd.socket for details.

An example server

Create an simple echo server at /opt/foo/serve.py.

@asiegman
asiegman / nginx.conf
Created January 29, 2015 16:29
nginx logstash output
# Output json-esque output for logstash to parse easily.
http {
# ...
log_format logstash_json '{"@timestamp": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
@JamesTheBard
JamesTheBard / i3lock_pixelate
Created June 8, 2013 00:04
The cool pixelated i3lock script provided by Steffan Honig.
#!/bin/bash
#
# This is an easier-to-tweak version of Steffen Honig's i3lock
# script. If it doesn't work, it's his fault ;)
#
TEMP_FILE=/tmp/lock.png
TEMP_FILE_POST=/tmp/lock.modified.png
BAR_BG_COLOR="orange"
BAR_FONT_COLOR="white"
BAR_FONT="Source-Code-Pro-Black"