Skip to content

Instantly share code, notes, and snippets.

@dixyes
dixyes / Readme.md
Last active April 20, 2024 13:24
ASUS ROG Zephyrus G14 2022 GA402RJ pci passthrough

ASUS ROG Zephyrus G14 2022 GA402RJ pci passthrough

This is a record for my own passthrough setup, I can finally use a single laptop for windows gaming and linux programming at the same time.

The device

My G14 is GA402RJ(6800HS + 6700s) with MT7922 WiFi/BT card.

At this time, BIOS version is 309.

@hazbo
hazbo / check-container.sh
Created January 30, 2015 14:34
A small script to remove (force) a container if it exists
#!/bin/bash
CONTAINER=$1
RUNNING=$(docker inspect --format="{{ .State.Running }}" $CONTAINER 2> /dev/null)
if [ $? -eq 1 ]; then
echo "'$CONTAINER' does not exist."
else
/usr/bin/docker rm --force $CONTAINER
@exiguus
exiguus / docker-swarm-wikijs-postgres.md
Created August 3, 2020 07:33
Docker Swarm with wiki.js and PgBouncer
@serg987
serg987 / tag2utf-0.17.py
Created December 31, 2023 02:42
Tool for encoding tags of mp3 files in the 1-byte charsets to unicode
#!/usr/bin/python
import os.path
import re
import os
import sys
import copy
import eyed3
from eyed3.id3.tag import Tag
helptext = """
@zer0k-z
zer0k-z / rampbugfix.md
Created April 3, 2024 23:27
CS2KZ's rampbug fix

Introduction

In CS2, when a player is sliding/surfing against some geometry, it's possible that they lose all their momentum/velocity. This is usually called wallbug/rampbug. While the name was inherited from Source 1 games (such as CS:GO, CS:S, TF2,...), rampbugs in CS2 behave much differently from its predecessor. In contrast to source 1 games, it's also possible have the velocity redirected to another direction instead of losing all momentum.

This bug doesn't seem to be common in all source 2 games (HL:A for instance, does not have this bug), and was orignially not present in the very early versions of CS2 Limited Test. Rampbugs become more and more frequent over time, with the Call to Arms update effectively doubling the frequency of these bugs, which is a significant problem for custom gamemodes heavily depending on geometry collision (eg. surf).

Keep in mind that while the player collision hitbox is a box, the images shown below will represent the player as a dot instead for simplicity.

Observati

@denji
denji / nginx-tuning.md
Last active April 20, 2024 13:14
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@kohya-ss
kohya-ss / gradio_llm.py
Last active April 20, 2024 13:13
gradioでLLMを利用する簡易クライアント
# Apache License 2.0
# 使用法は gist のコメントを見てください
import argparse
from typing import List, Optional, Union, Iterator
from llama_cpp.llama_chat_format import _convert_completion_to_chat, register_chat_completion_handler
import llama_cpp.llama_types as llama_types
from llama_cpp.llama import LogitsProcessorList, LlamaGrammar
from llama_cpp import Llama, llama_chat_format
import gradio as gr
@jamesr2323
jamesr2323 / rmse_loss.py
Created May 9, 2018 02:40
How to use RMSE loss function in PyTorch
# Thanks https://discuss.pytorch.org/t/rmse-loss-function/16540
class RMSELoss(torch.nn.Module):
def __init__(self):
super(RMSELoss,self).__init__()
def forward(self,x,y):
criterion = nn.MSELoss()
loss = torch.sqrt(criterion(x, y))
return loss
@throwaway96
throwaway96 / crashd.md
Last active April 20, 2024 13:12
crashd instructions

News

Important: Dev Mode app patch and alternatives (2024-04-14)

Since approximately 2024-04-02, the latest LG Dev Mode app (2.1.2 in the Content Store) copies and resets the permissions of jail_app.conf/jail_app.conf.sig on every boot. Therefore, jailpatch.sh etc. will no longer work.

If you have webOS 5+ and old enough firmware, WTA (which does not require Dev Mode) will still work.

If you have webOS 4.x, you can try CVE-2023-6319. It is unpatched on the latest (final?) firmware for webOS 4.0 (2018) models.