Skip to content

Instantly share code, notes, and snippets.

@fnx4
fnx4 / fnx_gpu_fan.sh
Last active September 7, 2018 00:06
Nvidia GPU 3D fan stop fix (50° С)
#!/bin/bash
export DISPLAY=:1
DELAY=5
LOW=40
HIGH=70
#nvidia-xconfig --allow-empty-initial-configuration
nvidia-settings -a [gpu:0]/GPUFanControlState=1 > /dev/null
if (((srcHeight >= 800) or (fileName = "*1080*")) and (fps < 31))
"mpc.fnxSplit.1080p@30"
else if (fps > 30)
"mpc.fnxSplit.720p@60"
else if ((srcHeight > 600) or (fileName = "*720*"))
"mpc.fnxSplit.720p@30"
else "mpc.fnxSplit.576p@30"
@fnx4
fnx4 / mpcForceGPU.nip
Created January 30, 2018 21:50
nvidiaProfileInspector force GPU in MPC-HC
<?xml version="1.0" encoding="utf-16"?>
<ArrayOfProfile>
<Profile>
<ProfileName>Media Player Classic</ProfileName>
<Executeables>
<string>mpc-hc64.exe</string>
<string>mplayerc.exe</string>
<string>mpc-hc.exe</string>
</Executeables>
<Settings>
#!/bin/bash
day=$(date +%F)
bfile="backup$day.tgz"
echo "Started: "
date
echo
#service apache2 stop
#service icinga2 stop
#service mariadb stop
#service mysql stop
@fnx4
fnx4 / index.php
Last active December 25, 2021 22:15
Ранобэ.рф парсер
<html>
<head>
<meta charset="UTF-8">
<title>Ранобэ.рф парсер</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<style>
* {
font-family: sans-serif;
}
</style>
import re
with open('input.txt') as f:
a = f.read()
arr = list()
# verb ambush /ˈæˌmbʊʃ/ находиться, сидеть в засаде 1. Wait in hiding to attack. Syn: scupper, bushwhack, waylay, ... 2. Hunt (quarry) by stalking and ambushing. Syn: still-hunt.
# noun ambush /ˈæˌmbʊʃ/ засада The act of concealing yourself and lying in wait to attack by surprise. Syn: ambuscade, lying in wait, trap.
for line in a.split('\n'):
@fnx4
fnx4 / cvs.sh
Last active March 29, 2020 11:51
#!/bin/bash
sudo find /etc/openvpn/ -name "*.conf" -type f -delete
for file in conf/*.ovpn; do
mv -f "$file" "$(basename "$file" .ovpn).conf" 2>/dev/null
done
sudo cp -r conf/* /etc/openvpn/
sudo cp auth/login /etc/openvpn/
sudo find /etc/openvpn -type f -exec sed -i 's/auth-user-pass/auth-user-pass login/g' {} \;
sudo rm -f /var/log/check-vpn-speeds.log
sudo touch /var/log/check-vpn-speeds.log

Keybase proof

I hereby claim:

  • I am fnx4 on github.
  • I am fnx (https://keybase.io/fnx) on keybase.
  • I have a public key whose fingerprint is 0935 C2E1 F0A4 C336 CCB8 FA06 03E8 8D3C 382E C2B4

To claim this, I am signing this object:

#!/bin/bash
folder="spectrogram";
declare -a formats=("mp3" "m4a" "ogg" "aac" "flac");
rm -rf "$folder";
mkdir "$folder";
for f in *."${formats[@]}" **/*."${formats[@]}"; do
if [ -f "$f" ]; then
echo "./$f";
if ! [ -f "./${f##*/}" ]; then
mkdir -p "$folder/${f%/*}";
@ECHO OFF
rem chcp 1251
set input_folder="C:\Users\fnx\GoogleDrive\Books"
set output_folder="F:\Books"
echo input_folder: %input_folder%
echo input_folder: %output_folder%
echo
echo --------------------------------------------
echo in:
dir /a %input_folder%