Skip to content

Instantly share code, notes, and snippets.

@tserj
tserj / clDeviceQuery.cpp
Last active April 19, 2026 13:23 — forked from tzutalin/clDeviceQuery.cpp
Query OpenCL devices
/* Copyright 1993-2009 NVIDIA Corporation. All rights reserved.
Modified by Mark Zwolinski, December 2009
Modified by Robert McGibbon, August 2013
*/
#define CL_TARGET_OPENCL_VERSION 220
#ifdef __APPLE__
#include <OpenCL/opencl.h>
#else
#include <CL/cl.h>
@tserj
tserj / iterm2-solarized.md
Created July 23, 2018 12:46 — forked from tzutalin/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@tserj
tserj / how-to-install-latest-gcc-on-linux-mint.txt
Created July 24, 2018 16:56 — forked from youmych/how-to-install-latest-gcc-on-linux-mint.txt
How to install latest gcc on Linux Mint 18 (18.3)
These commands are based on a askubuntu answer http://askubuntu.com/a/581497 and https://askubuntu.com/questions/26498/choose-gcc-and-g-version
To install gcc-7 (gcc-7.2.0), I had to do more stuff as shown below.
USE THOSE COMMANDS AT YOUR OWN RISK. I SHALL NOT BE RESPONSIBLE FOR ANYTHING.
ABSOLUTELY NO WARRANTY.
If you are still reading let's carry on with the code.
sudo apt-get update && \
sudo apt-get install build-essential software-properties-common -y && \
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y && \
@tserj
tserj / Linux help
Last active May 30, 2024 10:13
Linux help
Show file in HEX and text view (as old dos navigator, norton commander, etc..)
hexdump -C file.name
Simple local server running on port 8000 within home dir:
python -m SimpleHTTPServer
Check graphic driver info: inxi -Gx
IP addres parsing: /sbin/ifconfig wlp2s0 | grep 'inet addr' | awk '{print $2}' | sed -e 's/.*://'
Check difference on 2 text files:
@tserj
tserj / ag-replace.sh
Created October 22, 2018 12:17 — forked from cef62/ag-replace.sh
Search and replace using the silver searcher and sed
#!/usr/bin/env zsh
# Currently the script will choke on tilde characters used in either search or
# replace terms
# inspired by
# https://gist.github.com/hlissner/db74d23fc00bed81ff62
# https://gist.github.com/kates/5915285
# ag
@tserj
tserj / linux build
Last active February 11, 2023 05:39
linux build
configure.ac
AM_INIT_AUTOMAKE([foreign subdir-objects]
AC_CONFIG_MACRO_DIR([m4])
Makefile.am
ACLOCAL_AMFLAGS = -I m4
mkdir m4
autoreconf -i
@tserj
tserj / add_all_items_from_quixel.md
Last active September 21, 2024 02:00 — forked from jamiephan/README.md
A script to automatically add ALL items to your account in quixel

Script to add all items from quixel

As quixel is being removed, all items are free to aquire. This script is to automate the process to add items to your account (As of writing, a total of 18874 items)

Note: This script only tested in the latest version of Chrome.

How to use

  1. Copy the script from below (run.js)
  2. Login into https://quixel.com
@tserj
tserj / ban_from_error_log.sh
Last active September 24, 2024 02:30
how to ban IPs from nginx error log
#!/bin/bash
# Source and destination files
LOG_FILE="/var/log/nginx/error.log"
DENY_FILE="/etc/nginx/conf.d/deny.block"
# Temporary file to hold the new unique entries
TEMP_FILE=$(mktemp)
# Extract unique IPs from the error log excluding 0.0.0.0 and 185.32.132.29
@tserj
tserj / docker autoloading
Last active November 18, 2024 22:46
Docker
--------- .bashrc в конце файла дописано:
# starting docker
./start-docker.sh
--------- start-docker.sh
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo dockerd &> dockerd-logfile &
docker start mysql57
docker start sftp
@tserj
tserj / unpack-unitywebdata1.0.py
Created February 26, 2025 18:28 — forked from siddolo/unpack-unitywebdata1.0.py
Unpack UnityWebData1.0 used in Unity WebGL games
#!/usr/bin/env python3
# Ref: https://github.com/HearthSim/UnityPack/issues/74
import sys
import os
from unitypack.utils import BinaryReader
SIGNATURE = 'UnityWebData1.0'
class DataFile: