Skip to content

Instantly share code, notes, and snippets.

@BigRedEye
BigRedEye / Makefile
Last active September 7, 2021 04:35
Stupid driver
flatten_dirs:
find . -type f -wholename '*/*' -not -path './.git/*' | sed 's@^\./@@g' | grep / | xargs -n1 ./gistify.sh pack
fold_dirs:
ls | grep '%' | xargs -n1 ./gistify.sh unpack
driver_c:
$(CC) -c driver.c -o driver-c.o -Wall -Werror -fpic -std=c17 -O3
$(CC) driver-c.o -o libmydriver-c.so -shared -O3
rm driver-c.o
@n-at
n-at / backup.sh
Created May 8, 2015 08:38
ONLYOFFICE backup & restore
#!/bin/bash
CONTAINER_NAME="onlyoffice_communityserver_1"
ONLYOFFICE_HOME="/var/www/onlyoffice"
ONLYOFFICE_DATA="$ONLYOFFICE_HOME/server_data"
ONLYOFFICE_BACKUP="$ONLYOFFICE_HOME/server_backup"
DATE=`date +%F-%H-%M-%S`
@bluenex
bluenex / libpng_fix.md
Last active August 9, 2023 14:50
fixing 'libpng warning: iCCP: known incorrect sRGB profile' appears in Pygame.

Libpng warning: iCCP: known incorrect sRGB profile.

Some .png images used in pygame may get the warning read as "libpng warning: iCCP: known incorrect sRGB profile". To solve this I have searched and found the solution by using ImageMagick. After installing, single file can be fixed by calling convert <in_img> -strip <out_img>, but to make it fixes every wanted images in path we'll need to modify just a little bit.

Create .bat file contains the following code and place this .bat in the folder that want to be fixed and run to finish it out.

@echo off
ping -n 2 127.0.0.1 > nul

echo this batch will convert ".png" using -strip option from ImageMagick.
@nathanielc
nathanielc / gist:9b98350ccbcbf21256d7
Created August 20, 2014 05:07
Minecraft systemd unit file
[root@plex ~]# cat /etc/systemd/system/[email protected]
[Unit]
Description=Minecraft Server %i
[Service]
WorkingDirectory=/opt/minecraft-%i
User=mcserver
ExecStart=/usr/bin/screen -DmS mc-%i /bin/java -Xmx2048M -jar minecraft_server.jar nogui
@gjorquera
gjorquera / console.cpp
Last active January 6, 2025 23:53
Qt way to read from stdin.
#include <iostream>
#include "console.hpp"
void Console::run()
{
std::cout << "First message" << std::endl;
std::cout << "> " << std::flush;
connect(m_notifier, SIGNAL(activated(int)), this, SLOT(readCommand()));
}