Skip to content

Instantly share code, notes, and snippets.

View Francesco149's full-sized avatar
:shipit:
memes

lolisamurai Francesco149

:shipit:
memes
View GitHub Profile

shigebot 2.0

by Franc[e]sco/lolisamurai

Available commands for channel #lolisamurai (+ = mod only):

  • !hi: hi
@Francesco149
Francesco149 / gentoo-xsp-build-fix.sh
Created September 12, 2016 12:13
Fix for building dev-dotnet/xsp on gentoo
su
ln -s mcs /usr/bin/gmcs
ebuild /usr/portage/dev-dotnet/xsp/xsp-2.10.2-r2.ebuild fetch
ebuild /usr/portage/dev-dotnet/xsp/xsp-2.10.2-r2.ebuild unpack
cd /var/tmp/portage/dev-dotnet/xsp-2.10.2-r2/work/xsp-2.10.2
sed -i 's|\(/mono/2.0\)|\1-api|' configure
sed -i 's|\(/mono/4.0\)|\1-api|' configure
ebuild /usr/portage/dev-dotnet/xsp/xsp-2.10.2-r2.ebuild compile
ebuild /usr/portage/dev-dotnet/xsp/xsp-2.10.2-r2.ebuild install
ebuild /usr/portage/dev-dotnet/xsp/xsp-2.10.2-r2.ebuild qmerge

How to disable font antialiasing on Firefox

On many distros (in my case mint) firefox does not pick up fontconfig settings when you disable font antialiasing or mess with the hinting. Especially if it's statically linked to its own cairo instead of using the system's version.

This is easily fixed by creating a .fonts.conf file in your home directory that forces the desired hinting and antialiasing values:

cat > ~/.fonts.conf << "EOF"
@Francesco149
Francesco149 / osu_on_linux_overhaul.md
Last active April 12, 2024 21:56
Ultimate guide to low-latency osu on linux

Detecting and dealing with weird file name encodings in zip files on Linux

A friend of mine recently asked me for help on a specific zip file that was supposed to contain a bunch of files with japanese names.

No matter what was used to extract or what the system locale was set to, the file names would end up garbled. We tried unzip and 7z to no avail.

After some googling I found guides that explained that you have to prevent 7z from automatically converting to utf8 by unzipping with LC_ALL=C and

name of display: :0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_create_context_robustness, GLX_ARB_fbconfig_float, 
    GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample, 
    GLX_EXT_create_context_es2_profile, GLX_EXT_create_context_es_profile, 
@Francesco149
Francesco149 / pitcairn_linux_clock_fix.md
Last active September 9, 2022 18:41
Gain massive GPU performance for Southern Islands AMD GPUs on Linux by removing DPM quirks in the kernel

Gain massive GPU performance for Southern Islands AMD GPUs on Linux by removing DPM quirks in the kernel

I recently found out that my r9 270x GPU was not hitting full clock speeds because it was being throttled by the kernel based on old bug reports on DPM stability. This was an easy fix on gentoo where recompiling the kernel is trivial, but on ubuntu and similar, rebuilding the kernel is not so straightforward, so here's a guide based on ubuntu 16.04 LTS. If you run gentoo or know what you're doing you can just skip to the relevant code.

On my r9 270x, this resulted in an overall improvement in frame-rates of up to 50%: Unigine Valley went from something like 30-40 fps average to 55-60 and osu! (running in wine) went from 0.33 ms (~3000fps) to 0.25ms (~4000fps).

Note that I'm no linux god and all this info was pieced together by googling and asking on forums (credits to the guys at phoronix for pointing me to the quirks code).

If you're using the proprietary amdgpu-pro driver, read until the end of the

Setting up ati/radeon acceleration on Sabotage Linux

With the recent addition of mesalib-radeon with gallium radeon drivers, many modern radeon gpu's are now fully supported with 3D acceleration.

Note that, while I have a working system with these radeon drivers, these guidelines are purely written from what I remember doing and are not tested on a clean install. Please report any mistakes or missing steps.

diff --git a/audio/AudioInput.cpp b/audio/AudioInput.cpp
index 674b955..4039021 100644
--- a/audio/AudioInput.cpp
+++ b/audio/AudioInput.cpp
@@ -56,6 +56,7 @@ AudioInput *AudioInput::Create(std::string deviceID){
#endif
return new AudioInputWASAPI(deviceID);
#elif defined(__linux__)
+#ifndef LIBTGVOIP_WITHOUT_PULSE
if(AudioInputPulse::IsAvailable()){
@Francesco149
Francesco149 / minupload
Last active February 14, 2019 10:38
minimal file sharing/upload server example in python 2.7
#!/usr/bin/env python
"""
minimal example of a file sharing service in python 2.7 using only built-ins
there is no error check or security, this is meant to be as a base/reference
to quickly get started
This is free and unencumbered software released into the public domain.
http://unlicense.org/