Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
# Make sure to enable nvidia-xconfig --cool-bits=4
# nvidia-settings -a "[gpu:0]/GPUFanControlState=1" -a "[fan-0]/GPUTargetFanSpeed=5"
#[ $( pgrep -c FanCurveScript ) -lt 2 ] || exit 1 # already running
newfanspeed="0"
while true
do
gputemp=$(nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader,nounits)
@rkfg
rkfg / gifcreate
Last active February 4, 2021 21:01
GIF animation script to cut a piece of video and produce a frame-accurate optimized GIF with a precise framerate.
#!/bin/sh
help () {
log "Usage: `basename $0` [-h] [-n] [-a] [-u] [-s hh:mm:ss] [-d ss] [-w px] [-f n] [-S n] [-b n] [-t subtitle.sub] [-c default | basic | fontsize | fontstyle | full] <filename> [result.gif]
-h show this help
-n turn off subtitles
-a don't open directory with frames in filemanager
-u update this script from gist. Create .gifupd file in the script's directory to automatically check for updates once per day or put the number of seconds in the file to check with that period.
-s start time in seconds or as hours:minutes:seconds, default: 0
@rkfg
rkfg / switchdisplay.sh
Created September 3, 2018 11:17
Display switcher
#!/bin/sh
DISPLAY=:0
MAIN=DVI-D-0
TV=HDMI-0
if xrandr --listactivemonitors | grep -q "$MAIN"
then
xrandr --output "$MAIN" --off
xrandr --output "$TV" --auto
else
xrandr --output "$TV" --off
@rkfg
rkfg / test_fs.cpp
Created May 17, 2018 08:09
Read-only FUSE filesystem in C++
#include <iostream>
#include <cstring>
#include <unordered_map>
#include <memory>
#include <boost/unordered_map.hpp>
#define FUSE_USE_VERSION 26
#define _FILE_OFFSET_BITS 64
#include <fuse.h>
@rkfg
rkfg / pickpoint.sh
Last active May 16, 2018 10:31
Torrefacto Pickpoint delivery tracking
#!/bin/sh
PAGE=$( wget -qO- --post-data="shop=5742011_923%2C1979335517_923%2C1262625646_923&order_number=$1" https://pickpoint.ru/monitoring/msearch.php )
echo "$PAGE" | sed -n 's#.*\(Текущий статус :[^<]*\).*#\1#p'
PARAMS=$(echo "$PAGE" | sed -n 's#.*onclick="monitoring.show_history(&quot;\([0-9]*\)&quot;, &quot;\([0-9]*\)&quot.*#id=\1\&owner_id=\2#p')
wget -qO- "https://pickpoint.ru/monitoring/mhistory.php?$PARAMS" | sed -n 's#.*<tr><td>\([^<]*\)</td><td>\([^<][^<]*\)</td></tr>.*#\1 — \2\n#gp'
diff --git a/lsp4e-cpp/org.eclipse.lsp4e.cpp.target/cdt-plus-lsp4e.cpp.target b/lsp4e-cpp/org.eclipse.lsp4e.cpp.target/cdt-plus-lsp4e.cpp.target
index e09ad704d2..aaa5586f90 100644
--- a/lsp4e-cpp/org.eclipse.lsp4e.cpp.target/cdt-plus-lsp4e.cpp.target
+++ b/lsp4e-cpp/org.eclipse.lsp4e.cpp.target/cdt-plus-lsp4e.cpp.target
@@ -48,7 +48,7 @@
<unit id="org.eclipse.test.feature.group" version="0.0.0"/>
<unit id="org.eclipse.sdk.ide" version="0.0.0"/>
<unit id="org.eclipse.equinox.executable.feature.group" version="0.0.0"/>
-<repository location="http://download.eclipse.org/eclipse/updates/4.7milestones/"/>
+<repository location="http://download.eclipse.org/eclipse/updates/4.8milestones/"/>
diff --git a/src/qtbase-1-fixes.patch b/src/qtbase-1-fixes.patch
index c3f14eab..85e25dc2 100644
--- a/src/qtbase-1-fixes.patch
+++ b/src/qtbase-1-fixes.patch
@@ -104,91 +104,26 @@ index 31d6285..8e24520 100644
--
2.9.3
-
-From e4da2904bcab29d15ad137508390bec0595c0e72 Mon Sep 17 00:00:00 2001
13:10:07,659 INFO ~ Allocating [LOOP_ITER] workspace of 0 bytes...
13:10:07,821 INFO ~ [LOOP_ITER] spilled DEVICE array of 1152 bytes, capacity of 288 elements
13:10:07,831 INFO ~ [LOOP_ITER] spilled DEVICE array of 1152 bytes, capacity of 288 elements
13:10:07,840 INFO ~ [LOOP_ITER] spilled DEVICE array of 1152 bytes, capacity of 288 elements
13:10:07,844 WARN ~ Workspace initialization OVER_TIME was selected, but number of cycles isn't positive value!
13:10:07,844 INFO ~ Allocating [LOOP_FF] workspace of 0 bytes...
13:10:07,844 INFO ~ Allocating [LOOP_FF] workspace of 0 bytes...
13:10:07,844 INFO ~ [LOOP_FF] spilled DEVICE array of 1152 bytes, capacity of 288 elements
CUDA error at /home/rkfg/soft/svn-soft/libnd4j/blas/cuda/NativeOps.cu:4801 code=11(cudaErrorInvalidValue) "result"
Failed on [1110846756352] -> [1110844720640], size: [1152], direction: [2], result: [11]
package dlchat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import org.apache.commons.lang3.ArrayUtils;
import org.nd4j.linalg.api.ndarray.INDArray;
import org.nd4j.linalg.dataset.api.MultiDataSet;
import org.nd4j.linalg.dataset.api.MultiDataSetPreProcessor;
@rkfg
rkfg / log.txt
Last active March 30, 2017 08:23
11:21:40,746 INFO ~ Loaded [JCublasBackend] backend
11:21:41,201 INFO ~ Number of threads used for NativeOps: 32
11:21:41,334 INFO ~ Backend used: [CUDA]; OS: [Linux]
11:21:41,334 INFO ~ Cores: [8]; Memory: [23.1GB];
11:21:41,334 INFO ~ Blas vendor: [CUBLAS]
11:21:41,335 INFO ~ Device name: [GeForce GTX 1070]; CC: [6.1]; Total/free memory: [8507752448]
Building the dictionary...
Dictionary is ready, size is 40035
Total dictionary size is 40035. Processing the dataset...
Done. Corpus size is 281312